The first thing I wanted, was to make my buttons on my custommade menu light up as visitors hover their mouse over it.
I found a code that does just that
<script type="text/javascript"> $(document).ready(function(){ $("img").hover(function() { $(this).stop().animate({opacity: "0.8"}, 'slow'); }, function() { $(this).stop().animate({opacity: "1"}, 'slow'); }); }); </script>
|
It works perfectly, though the issue here is that it makes ALL pictures on my page light up as you hover your mouse over it, which is not what I intended to achieve.
The creator of this code said that if you want to have this effect affect only certain images, I had to made sure to change the first jQuery selector to the class name of the images.
As far as I know the "img" is the first selector, and since I only wanted to have this effect on my menu buttons, what do I do?
Do I have to write a second script, that determin the menu buttons class and then use that instead of "img" in the above code? Or is there something else?
Also, I tried to test it with a single image, where I tried to use "#imagename" which in my head, should do the trick as # = ID/name of the picture I want to change correct?