View Full Version : SAG Scroller - Suggestion

01-17-2013, 07:06 PM
SAG Scroller is great! I use it to scrolls ads.
Suggestion: It will be great if "random" option could be added to it so first image (ad) will change on every page load.
Thank you.

01-17-2013, 08:15 PM
Random means random, so it's possible you will get the same order and/or similar order twice or even more in a row. The more images or whatever you have, the less likely you will get repetitions, but it can still happen.

That said, in the head of the page, add this (highlighted) before the new sagscroller() command as shown:

//SAG scroller demo #1:
var contents = [], i, $parent = $('#mysagscroller ul:eq(0) >li').each(function(){
contents.sort(function(){return 0.5 - Math.random();});
i = contents.length;
while (--i > -1) {

var sagscroller1=new sagscroller({
mode: 'manual' //<--no comma following last option

Just make sure that the id in the new sagscroller() command is the same as that in the preceding code (red in both above).

The browser cache may need to be cleared and/or the page refreshed to see changes.

Here's a demo:


If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

01-18-2013, 04:57 AM
Thank you very much!!! Works like a charm.