Click here to Skip to main content
15,849,494 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I can't get my head around jQuery, but there's a library for it that fits my current project specs, so I've had to bite the bullet.
Here's the rub - I'm displaying the supersized slideshow on my page, and I've added a couple of buttons to the navigation bar at the bottom. These buttons open 'Lightbox' style pop ups providing more information on the current image. Everything works and all is good with the world, but the slideshow keeps on rolling along, and I need it to stop.

I've referred to the API docs, and there's a function that toggles the play / pause functionality:
JavaScript
$(element).click(function(){
	api.playToggle();
});

I get that this code adds a click handler to 'element', but how do I call this function myself from a non jQuery object in response to a click? I use javascript a lot, just not jQuery. My experience boils down to altering DOM object attribution client side, and I want to call this function in something like:
HTML
<div id="anotherElement"  önClick="api.playtoggle();">...

but because of my lack of jQuery knowledge, I have no idea of the actual call (the one above obviously doesn't work...). I'm guessing there's a dollar in there somewhere, and probably the name of the element, and maybe a bracket or two?
I've tried all sorts of combinations and none have worked - so any suggestions greatly appreciated...

Danny
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900