How to select all the id in jquery?
Description: I have lots of div with class name like this:
<div class="flipbox1">,<div class="flipbox2">,
<div class="flipbox3">,<div class="flipbox4">
etc.
i am selecting the div with this:
$(document).ready(function(){
var id=$('#img-txt a').attr('id').replace('flip','');
$("#flip"+id).on("click",function(e){
$(".flipbox"+id).flippy({
color_target: "red",
direction: "left",
duration: "750",
verso: "<span>Woohoo ! \\o/</span>",
});
e.preventDefault();
});
});
required js is: http://blog.guilhemmarty.com/flippy/jquery.flippy.min.js
Problem is var id is getting only first div's classs value. So only first
div is flipping.
I think this can be done using loop. How to use that.
No comments:
Post a Comment