I have a loop
$(".box").find('.video, .print, .web').closest('.box').each(function (index)
{
$(this).delay(100 * index).fadeIn(300);
});
This code works just fine. But I’m calling those 3 classes alot and I wanted to put it into a variable.
EX:
var resetBoxClass = ".print .web .video";
$(".box").find('resetBoxClass').closest('.box').each(function (index)
{
$(this).delay(100 * index).fadeIn(300);
});
To my disappoint i cannot get this to work… it is just dumb semantics? can someone explain to me why?
comma missing
resetBoxClass = ".print, .web, .video";&$(".box").find('resetBoxClass')should be$(".box").find(resetBoxClass)This will help,
Rest as below: