Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using 2 Carousels at once

Posted on 2012-03-23
2
Medium Priority
?
197 Views
Last Modified: 2012-04-30
Hello,

I have a page with 2 jquery carousels running at the same time - http://testing.arrivaldesign.co.uk

This is working fine, the arrows going left and right are working and the dots are working, but I need it so that the dots state changes as the carousel is going through, either automatically or when the arrows are clicked.

Can anyone offer any assistance?

Thanks,

Chris
0
Comment
Question by:djfenom
2 Comments
 
LVL 7

Accepted Solution

by:
Lalit Chandra earned 2000 total points
ID: 37758047
Oops Very hard but interesting to find the solution.. Just add the following line to your head script section



$(".jcarousel-control").find("a").removeClass("onstate").click(function() { $(this).addClass("onstate"); });

jQuery('.first-and-second-carousel').jcarousel({
itemLoadCallback: {
  onBeforeAnimation: function() {
     //$(".jcarousel-control").find("a").removeClass("onstate")
var j =$(".jcarousel-control").find(".onstate").removeClass("onstate").next("a").addClass("onstate");
if(j.length == 0) $(".jcarousel-control").find("a:first").addClass("onstate");
     
console.log("ok");
   
   }

}}
);

Hope this will work
0
 

Author Comment

by:djfenom
ID: 37764735
That works great thanks, only slight issue is that the left arrow makes the dots go forward and not backwards?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question