Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding animation to this testimonial slider

I have created a slider using CSS3 to display my testimonials.. Now I need to add some animation to this slider using Jquery. But I dont have any idea how to use Jquery with this slider.. and what are the suitable plugin for this. So anybody can tell me How can I add an animation to this slider?

any ideas are greatly appreciated.

Thank you.

Here is a link to the slider code: jsfiddle.net/XJVYj/82

like image 787
TNK Avatar asked Jan 02 '13 07:01

TNK


People also ask

What is a testimonial slider?

BigCommerce Testimonials Slider plugin is a simple tool to display customers' testimonials on your website in the most vivid and attractive way. You can use any type of feedback to make a trustworthy testimonial with author's name, photo, company logo and even a URL to the client's website.

How do I add a testimonial slider in Divi?

Testimonial Slider Archive Page SettingsIn the dashboard menu, go to Divi > Testimonial Settings. Here you can set the archive page slug, adjust the archive page settings, choose to display in a grid or list, the number of testimonials per page, to display the filter, pagination, and the detail page link.


1 Answers

I think it will be very hard to find a Plugin that exactly matches your code. But I could code you the jQuery stuff for it. But then I would have two Questions.

  1. How much of the CSS can I change? Or should it also still work without js activated?
  2. Are you staying with a number of 3 items in the future? Or do you want to change the number of slides dynamically?

// EDIT

OK it works now. I know its not very elegant, but I dont wanted to change too much of your code. So I just had to edit two of your css selectors (I commented the old one out). You also wanna notice, that with this solution your old method still works when javascript is disabled. The jQuery Code follows...

$("div.one").css({"left":0, "opacity":1});
$("div.two").css({"left":300, "opacity":1});
$("div.three").css({"left":600, "opacity":1});

$("input#first").click(function(){
    $("div.one").animate({left:0},600);
    $("div.two").animate({left:300},600);
    $("div.three").animate({left:600},600);
});

$("input#second").click(function(){
    $("div.one").animate({left:-300},600);
    $("div.two").animate({left:0},600);
    $("div.three").animate({left:300},600);
});

$("input#third").click(function(){
    $("div.one").animate({left:-600},600);
    $("div.two").animate({left:-300},600);
    $("div.three").animate({left:0},600);
});​

jsfiddle.net/mYhEV/2/

Hope it helps.

PS: For a cleaner solution you would have to rethink a bit. One method would be to put all the sliders in a wrapper and just moving this wrapper instead of moving.

like image 81
lukasgeiter Avatar answered Oct 01 '22 10:10

lukasgeiter