I have added classes to all of my elements but I want the classes to start from the number 4(first class is .cc_content_4 and the next .cc_content_5 and so on) so I tried to change the number the counter is set to. It didn’t work
Any ideas?
Here’s my code
$(".cc_submenu").find("ul.portfolio-list li").each(function(i){
i == 4;
$(this).addClass("cc_content_"+i);
var href = $(this).find("a").attr("href");
$(this).find("a").attr("href","#");
$('.cc_content .cc_content_'+i).load(href);
});
You’re using
i == 4which is an equality operator, not an assignment. Just change it toi += 4;