First off, I want to thank you for looking into my question as I really do appreciate your time.
I've built a list of items using php by having a foreach loop cycle through an associative array printing the array data as parameters of an onclick function call and gives each item it cycles through an ID of $thecount. All items retrieved have the same parent div and calls the very same onclick function, only with 11 different parameters.
My question is how do I go about calling the onClick("function();") of an item directly below the current focus, making it the new focus, only without a physic开发者_JAVA技巧al click?
If this is confusing to you whatsoever, I'm essentially building a dynamic playlist, and I've already implemented the listener for when the player's current item has finished playing, Now I'm having trouble grasping how I'd go about having the next item in the list become the new focus while also calling it's specific onClick() function once the player returns that it has finished with the current file. All without any user interaction besides the initial play call.
If it helps I'm using the most recent release of Longtails' JW Player
and once again thank you very much for your time!
You can simulate clicks using the .click() method a well as .trigger(). Here's my guess at what you're trying to do...
function clickedListItem(arg1, arg2, arg3) {
var $elem = $(this); // element that generated th click
var $nextElem = $elem.next(); // next in the list (sibling)
$nextElem.click(); // or $nextElem.trigger('click');
$nextElem.focus();
}
if you're looking to find the 'focused' element and THEN find it's sibling, check out this plugin: http://plugins.jquery.com/project/focused - you can then get it's sibling and send the click.
精彩评论