Advanced Search

Results 1 to 5 of 5

Thread: How to auto rotate?

  1. #1
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    24
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default How to auto rotate?

    Hello everybody;

    I need your help about my example website,i'm trying something but i couldn't it.

    If you click on OPINIONS,this will scrolling you directly to “happy clients”...

    There are 5 testimonials there and i have to click on for each one.
    I just want do this 5 testimonials AUTO ROTATE (i dont want to click on with mouse)...

    How to do this?

    Thank you for your help in advance.

    My example website is http://****.com.tr/
    Last edited by volkantr19; 11-08-2013 at 01:24 PM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,702
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    This will do it:

    Code:
    var counter = 0;
    setInterval(function(){var ops = $('#opinions-pages li a'); ops.eq((++counter)%ops.length).click();}, 3000);
    But you have to wait until after the opinions are initialized to do it. That appears to be here (in main.js):

    Code:
    		/* Set Opinios Pagination */
    		var pages = $('#opinions-list').find('li').length;
    		var active = '';
    		for(var i=1;i<=pages;i++)
    		{
    			active = (i===1) ? 'active':'';
    			$('<li><a href="#'+i+'" class="'+active+'">'+i+'</a></li>').appendTo('#opinions-pages');
    		}
    		
    		$('.slider-markers li a').on('click', function()
    		{
    			var id = '#comment-' + $(this).html();
    			var active_id = '#comment-' + $('.slider-markers').find('.active').html();
    			//$('.slider-regular').find('li').css('opacity','0').first().css('opacity','1');
    			
    			$('.slider-markers li a').removeClass('active');
    			$(this).addClass('active');
    			$(active_id).animate({opacity: 0}, 1000, function(){ $(active_id).hide(); })
    			setTimeout(function(){
    				$(id).css('display','block').animate({opacity: 1}, 1000);
    				}, 1000);
    			;
    		});
    So I'd add it right after that.

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

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    volkantr19 (11-08-2013)

  4. #3
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    24
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Sorry,nothing changed...

    I need more help from you please...

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,702
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    The ornek5.antalyabalikcilik.com.tr/js/main.js file has not been changed as I suggested. Do that first and let me see what happens. It's around line number 179 where the opinions code starts, add the highlighted:

    Code:
    		/* Set Opinios Pagination */
    		var pages = $('#opinions-list').find('li').length;
    		var active = '';
    		for(var i=1;i<=pages;i++)
    		{
    			active = (i===1) ? 'active':'';
    			$('<li><a href="#'+i+'" class="'+active+'">'+i+'</a></li>').appendTo('#opinions-pages');
    		}
    		
    		$('.slider-markers li a').on('click', function()
    		{
    			var id = '#comment-' + $(this).html();
    			var active_id = '#comment-' + $('.slider-markers').find('.active').html();
    			//$('.slider-regular').find('li').css('opacity','0').first().css('opacity','1');
    			
    			$('.slider-markers li a').removeClass('active');
    			$(this).addClass('active');
    			$(active_id).animate({opacity: 0}, 1000, function(){ $(active_id).hide(); })
    			setTimeout(function(){
    				$(id).css('display','block').animate({opacity: 1}, 1000);
    				}, 1000);
    			;
    		});
    		var counter = 0;
    		setInterval(function(){var ops = $('#opinions-pages li a'); ops.eq((++counter)%ops.length).click();}, 3000);
    - John
    ________________________

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

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    volkantr19 (11-08-2013)

  7. #5
    Join Date
    Sep 2013
    Location
    Antalya - Turkey
    Posts
    24
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much...

    You resolved my problem one more time...

Similar Threads

  1. AJAX Auto Scrolling
    By Moshambi in forum JavaScript
    Replies: 0
    Last Post: 02-20-2009, 08:04 AM
  2. Auto Scrolling in iframe
    By Stellahm in forum Looking for such a script or service
    Replies: 2
    Last Post: 06-29-2008, 01:02 PM
  3. auto image scrolling
    By ashishj10 in forum JavaScript
    Replies: 3
    Last Post: 06-09-2008, 02:08 PM
  4. Auto scrolling window
    By Hinsh in forum JavaScript
    Replies: 0
    Last Post: 03-05-2007, 08:24 PM
  5. auto scrolling to a <LI>
    By HockeyFan in forum HTML
    Replies: 1
    Last Post: 11-18-2005, 04:43 PM

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
  •