Giving a class to an element when it triggers a slider
I have a jQuery slider which uses little thumbnails in the bottom left and allows the users to click on the thumbnails to trigger certain slides.
I would like to give the selected thumbnails a new class when selected so essentially giving having them sync up with the slides.
Is this possible?
Here is my code.
<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true
});
}
window.addEvent('domrea开发者_运维知识库dy', startGallery);
</script>
Sorry, You have to edit the gallery
function. And add this jQuery function $('your-element-id').addClass("Your-New-Class noClass");
on successful selection of a thumbnail. And do not forget to remove the selected class from all the thumbnail before adding the selection class using $('your-all-thumb-element-class').removeClass("Your-New-Class");
. And do not forget to assign different id
to all thumb elements.
精彩评论