Is there a way to know the selected image (currently visible image) using JavaScript?
Are there any JavaScript events that fire when the carousel scrolls from one image to another. In short is there any JavaScript support for the Carousel widget?
Thanks.
Carousel JavaScript Events
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Take a look at client side api of carousel, there are lots of methods and events you can use.
http://developer.yahoo.com/yui/docs/YAH ... ousel.html
http://developer.yahoo.com/yui/docs/YAH ... ousel.html
I could not relate what I saw in the Yahoo site to the JSF carousel widget. Could you please (as an example)show how to implement "itemSelected" event for a JSF carousel widget.
I tried onitemselected="handleItemSelected();"
function handleItemSelected(){
alert("In handleItemSelected()");
}
It did not fire the event.
I think a good example will help. I looked at your documentation but could not find any related examples.
Thanks.
I tried onitemselected="handleItemSelected();"
function handleItemSelected(){
alert("In handleItemSelected()");
}
It did not fire the event.
I think a good example will help. I looked at your documentation but could not find any related examples.
Thanks.
Jonathan Ekwempu
TobiSoft Inc.
TobiSoft Inc.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Sure Jonathan, assume you have a carousel like the following, make sure you have defined a widgetVar.
Your script should run after document is loaded, body onload event would be fine. Or place your script after p:carousel.
Code: Select all
<p:carousel widgetVar="mycarousel" ... >
//items
</p:carousel>
Code: Select all
<script type="text/javascript">
function handleItemSelected(newValue){
alert("In handleItemSelected: " + newValue);
}
mycarousel.on('itemSelected', handleItemSelected);
</script>
Hi,
Can you please see to put your documentation page back? Right now the link https://developer.yahoo.com/yui/docs/YA ... ousel.html
says the page cannot be found.. Getting to know the list of carousel events will be helpful please. Thanks ahead!
Darshan
Can you please see to put your documentation page back? Right now the link https://developer.yahoo.com/yui/docs/YA ... ousel.html
says the page cannot be found.. Getting to know the list of carousel events will be helpful please. Thanks ahead!
Darshan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 38 guests