views:

120

answers:

1

I'm using a plugin that is obscure and doesn't have a good API and, rather than digging around and re-writing it the way I want, I want to just use it the way its built which is that it has a list within a DIV and an action occurs based on moving the mouse over a list item in this DIV.. I want to simulate this so that I can make another action in the page do this, however I'm not sure exactly how to do this.. so far I have:

This gets the list element:

testit =  $('#masker').find('li').slice(0,1) 

And I just found this on how to simulate but I'm not sure how to express the list element in this format since there is no ID or anything just a <li> within a DIV (so its going on the number of the <li> within the DIV

$("#element").hover(function(){
  //style some element(s) or do stuff.
});

EDIT:

I want to make it so, its something like this (when user hovers on Div id="mytestdiv" then it will call the action to simulate a hover on <li> #1 in "div id="masker"

$('#mytestdiv').mouseenter(handlerIn).mouseleave(handlerOut); 

calls this action

$('#masker').find('li').slice(0,1).hover(function(){
  //style some element(s) or do stuff.
});
+1  A: 

This is what you need:

$('#masker').find('li').slice(0,1).hover(function(){
  //style some element(s) or do stuff.
});
Kerry
great.. thanks, will try that
Rick
I made an edit, I want to make it so the action you gave is called by another action, I think I know how to do this part based on the info you gave so I will try that
Rick
this is what I was getting at, not sure if I worded the OP clearly enough, I can't seem to figure out how to do this properly:I want to make it so, its something like this (when user hovers on Div id="mytestdiv" then it will call the action to simulate a hover on <li> #1 in "div id="masker"
Rick
I suggest going through a jQuery tutorial it has a whole lot of those things. Select the element you want hovered over, then do `trigger('mouseover')`
Kerry