Log in

View Full Version : Resolved How to auto rotate?



volkantr19
11-07-2013, 05:54 PM
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/

jscheuer1
11-08-2013, 06:53 AM
This will do it:


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):


/* 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.

volkantr19
11-08-2013, 09:18 AM
Sorry,nothing changed...

I need more help from you please...

jscheuer1
11-08-2013, 01:45 PM
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:


/* 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);

volkantr19
11-08-2013, 02:21 PM
Thank you so much...

You resolved my problem one more time...