jQuery('ul#reorderps ul ul li').mouseover(
function(){
jQuery(this).css("cursor","pointer");
var position= jQuery(this).position();
jQuery("#up").click(function() {
alert('hey');
});
}
);
I expect that it does alerts ‘hey’ one time when i mouseover on that particular element. But it does it for the size of the selected li’s. Whats wrong and how can i resolve it.Actually i have to pick up the element on which the mouse is over when clicking on the up id button.
here is the html snippet its actually i long html so only posting a part.
<ul id="reorderps">
<li>Financial</li>
<ul>
<li>Hardware</li>
<ul>
<li>Product 1</li>
<li>Product 2</li>
<li>Product 3</li>
<li>Product 4</li>
<li>Product 5</li>
<li>Product 6</li>
<li>Product 7</li>
<li>Product 8</li>
</ul>
<li>Software</li>
You are binding a click event on a mouseover event. I think your want this:
Now if you click on the div #up, it will alert
heyand on the LI mouseover it will saymouseover. If you want to have a click event on an element within the LI’s. Do the following:EDITED
Each LI has a button up and down? Then you can do this