Results 1 to 3 of 3

Thread: SAG Scroller - Suggestion

  1. #1
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile SAG Scroller - Suggestion

    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.
    Regards.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    //SAG scroller demo #1:
    jQuery(function($){
    	var contents = [], i, $parent = $('#mysagscroller ul:eq(0) >li').each(function(){
    		contents.push(this);
    	}).parent();
    	contents.sort(function(){return 0.5 - Math.random();});
    	i = contents.length;
    	while (--i > -1) {
    		$parent.append(contents[i]);
    	}
    });
    
    var sagscroller1=new sagscroller({
    	id:'mysagscroller',
    	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:

    http://home.comcast.net/~jscheuer1/s...oller/demo.htm

    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.
    Last edited by jscheuer1; 01-17-2013 at 10:23 PM. Reason: add demo
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much!!! Works like a charm.

Similar Threads

  1. A little php help/suggestion
    By jzhang1013 in forum PHP
    Replies: 2
    Last Post: 08-29-2009, 03:21 AM
  2. Fading Scroller Suggestion/Comment
    By Moooink in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 12-04-2004, 05:44 PM
  3. Fading Scroller Suggestion/Comment
    By Moooink in forum JavaScript
    Replies: 0
    Last Post: 11-29-2004, 03:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •