tags:

views:

36

answers:

1

I am using a table navigation menu in my website in that i have used JQuery fadeTo() for when I mouse over the menu items (<td>) it working only once. After same menuitem mouseover is not working. Please tell me whats wrong in my code?

$(document).ready(function() {  
    $("table.nav td").mouseover(function() {
        $("table.nav td:hover").fadeTo("slow", 1.0);
    });
});
A: 

Are you reseting the opacity at any point in your code?? It looks like you fade to one opacity setting on mouseover but don't reset the opacity on mouseout. You are permanently setting the opacity. Maybe try using hover instead of mouseover and define opacity settings over and out....

nicholasklick
I have fixed opacity in stylesheet table.nav td:hover{ opacity:.2} i will change at runtime fadeTo() as 100%. Then how i can reset in same JQuery?
sankar
Add `$(...).mouseout(function() { fadeIn(...) } ) ;` to your existing code so the element will fade in (to it's original opacity) when the mouse moves out.
FK82
I have used like this my problem solved. Thank you for your guide $(document).ready(function() { $("table.nav td").hover(function() { $("table.nav td:hover").css("opacity", "0.1").fadeTo("slow", 1.0); }); });
sankar
If my solution helped you maybe you could like my answer or give some props or something....?
nicholasklick