Solved

Using 2 Carousels at once

Posted on 2012-03-23
2
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Lalit Chandra earned 500 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

624 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