I’m new to programming. I’m currently trying to use the jqueryrotate plugin to try to randomly rotate all the images in my HTML div .holder to get that scattered picture look.
I know the $.each function should be used on arrays… but I can’t think of anything else to iterate through my images. Any suggestions?
$.each($('.holder img'), function(i, value){
value.rotate(Math.random() * -90 + Math.random() * 90);
});
When you pass an array of objects you can access the current using
this, but it’s not a jQuery object, so you should use$(this)to chain with.rotate.Reference