Solved

Using 2 Carousels at once

Posted on 2012-03-23
2
189 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 500 total points
Comment Utility
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
Comment Utility
That works great thanks, only slight issue is that the left arrow makes the dots go forward and not backwards?
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now