There is some flickering when I use the show and hide functionality on my divs. I'm using the following code now:
$(document).ready(function(){
$("#tekstvanitem-1").hide();
$("#thumbnail-1").hover(function(){
$("#tekstvanitem-1").show();
},function(){
$("#tekstvanitem-1").hide();
});
});
The problem is when i rollover thumbnail-1 it show tekstvanitem-1. But because tekstvanitem-1 pops up over thumbnail-1 it then looks like its flickering because im not on thumbnail-1 anymore. So it's kind of a loop.
Is it possible to set the hover element when either my mouse is on thumbnail-1 or if my mouse is on tekstvanitem-1?
thanks in advance!
You can apply :hover styles to any renderable element on a page. IE6 only supports that pseudo-class on links though.
The hover() is an inbuilt method in jQuery which is used to specify two functions to start when mouse pointer move over the selected element.
You might have linked your stylesheet to your HTML file improperly. Some other CSS in the context of your project may be overriding the piece that you've given here. You might be running into browser compatibility issues with the :hover selector or something else in your code that is breaking the styling.
You can simply use the CSS :hover pseudo-class selector in combination with the jQuery mousemove() to check whether the mouse is over an element or not in jQuery. The jQuery code in the following example will display a hint message on the web page when you place or remove the mouse pointer over the DIV element's box.
Sure. Just put #tekstvanitem-1
in the selector...
$(document).ready(function(){
$("#tekstvanitem-1").hide();
$("#thumbnail-1, #tekstvanitem-1").hover(function(){
$("#tekstvanitem-1").show();
},function(){
$("#tekstvanitem-1").hide();
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With