0

I am creating a table and replacing it in to a div in an aspx page. In that table I have four columns and in each columns i have a particular class. The content of div (ie table) will be changed using $ajax() everytime when a dropdownlist changes it value.I am getting the table and it will be coming inside the div.What i requires is I need to do jquery.hover() in that particular class.So how can i do by giving the class name. I have already tested $.('.ovr')bind(mouseover,mouseout).But this is also not works. Can u pls give a solution?

1
  • Does $('.ovr').hover(mouseover, mouseout) not work? Commented Nov 30, 2010 at 4:53

2 Answers 2

3

to bind a "hover" event manually you have to bind the mouseenter and mouseleave events (jQuery's hover documentation mentions that hover actually binds mouseenter and mouseleave event handlers). Something like this should work:

$("...").bind("mouseenter mouseleave", function(e) {
    if (e.type == "mouseenter") {
        // hover in
    } else {
        // hover out
    }
});

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

1

Try something like this:

$(document).ready( function(){

  $('#id_of_your_table')
    .delegate('.ovr','mouseover',function(){
      your_mouseover_behavior();
    })
    .delegate('.ovr','mouseout',function(){
      your_mouseout_behavior();
    });

});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.