steventnorris
steventnorris

Reputation: 5896

jquery set to function with parameters

I have a mouseover that looks like the below

onmouseover='$(this).css(\"cursor\",\"pointer\");infoCardIn("uid")'

I'd like to change it in a jquery function to look like this

onmouseover='$(this).css(\"cursor\",\"pointer\");infoCardIn("uid2")'

I can't seem to get the syntax right. Help?

Upvotes: 1

Views: 88

Answers (1)

N. Taylor Mullen
N. Taylor Mullen

Reputation: 18301

$("#myItem").hover(function() { // Mouse in method
    $(this).css("cursor","pointer");
    infoCardIn("uid2");
}, function() { // Mouse out method
    $(this).css("cursor","");
});

See http://api.jquery.com/hover/ for details.

Hope this helps!

Upvotes: 2

Related Questions