jquery - Add images on class on document load Event -
i have created image slider. on document load event adding left images in t1 class give them alignment. adding right side images in t2 bend in other angle.
but problem when images loaded face in same direction. after click of image getting aligned perfectly.
this fiddle :: http://jsfiddle.net/simmi_simmi123/pukjw/
$(document).ready(function () { $('#myimageflow img').slice(1,5).addclass('t1'); $('#myimageflow img').slice(-3).addclass('t2'); $("div img:first-child").removeclass('t2'); alert("first freeeeeeee"); $("img").click(function(){ console.log('i image flip'); var t = $(this); this.classname = ''; t.prevall().removeclass('t2').addclass('t1'); t.nextall().removeclass('t1').addclass('t2'); }); }); thanks.
you applying rotation when image clicked. solve this, select first image , apply rotation others.
$("#myimageflow img:first").nextall().removeclass('t1').addclass('t2'); your updated fiddle - http://jsfiddle.net/pukjw/4/
ive added hover functionality, , updated css make easier see images...
Comments
Post a Comment