Hi i am new to jquery and iam tryiing for days now , I canot make it work for all the divs to radomly change on browser renewal and not only for the 4 divs. I want in my web site to advertise restaurants and i want every time someone is visiting to show the restaurants in different order i am sure is something sipmle but if you dont know it it seems very difficult ! Any help it will be fantastic , thank you in advanced.
It is for the code below " showing-random-divs-using-jquery" wich i found in the this link Showing random divs using Jquery
$(document).ready(function() {
$(".Image").hide();
var elements = $(".Image");
var elementCount = elements.size();
var elementsToShow = 4;
var alreadyChoosen = ",";
var i = 0;
while (i < elementsToShow) {
var rand = Math.floor(Math.random() * elementCount);
if (alreadyChoosen.indexOf("," + rand + ",") < 0) {
alreadyChoosen += rand + ",";
elements.eq(rand).show();
++i;
}
}
});