jquery - Add Last Child Elements of <div> in some Class -
my <div>
contains 10 images. want add class last 3 images. how it?
$(document).ready(function () { $('img').addclass('t2'); $('#myimageflow img').slice(12, 16).addclass('t1'); $("div img:first-child").removeclass('t2'); }
i tried not working.
my contains 10 images. want add last 3 images class....
then why use slice(12, 16)
?! use slice(-3)
$('#myimageflow img').slice(-3).addclass('t1');
Comments
Post a Comment