Answer the question
In order to leave comments, you need to log in
Assign random class to list on click?
Each new page (list) load assigns a random class to an N-list element...
var random = Math.floor(Math.random() * 1000);
var $li = $("#gallery li");
$li.eq(random % $li.length).addClass("on");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question