javascript - Hiding an object using css -
i trying hide vertical bar have created in jquery flot graph when mouse not within bounds of grid. set me horizontal bounds grid such: horizontalbounds = [leftoffset, plot.width() + leftoffset];
. used if statement "if mouse within vertical bounds, verticalbar.css."
if (position.pagex >= horizontalbounds[0] && position.pagex <= horizontalbounds[1]) { if (typeof verticalbar !== "undefined" && verticalbar !== null) { verticalbar.css({ transform: "translate(" + position.pagex + "px, 0px)" }); }
below css code (which in javascript file; don't ask...). need hide verticalbar when mouse not within horizontal bounds? thinking add attribute `visibility: hidden' verticalbar.css, can't figure out how that. hints?
verticalbar.css({ backgroundcolor: "#f7e4e6", width: "1px", height: "100%", position: "absolute", padding: 0, margin: 0, left: 0, transform: "translatex(" + plot.getplotoffset().left + "px)" }); }
try using "display:none;" in css.
Comments
Post a Comment