Jump to content
Search Community

Search the Community

Showing results for tags 'sizmekcarousel'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

Found 1 result

  1. I have a banner that has a carousel where each slide has a different clickthrough url. Clickthroughs are added to divs with addEvent. It all seems to work until the carousel loops back to the beginning, when the clickthrough don't work anymore. Here is the js.. (function checkInit() { try { EB.isInitialized() ? onInit() : EB.addEventListener(EBG.EventName.EB_INITIALIZED, onInit()) } catch (a) { onInit(); }})(); function onInit() { animate(); } function animate(){ var delayed = 1.75; // TweenMax.to(".intro", 1, {y:-250, delay:delayed,ease:Power4.easeIn}); } // Support IE events function addEvent(evnt, elem, func) { if (elem.addEventListener){ // W3C DOM elem.addEventListener(evnt,func,false); }else if(elem.attachEvent){ // IE DOM elem.attachEvent("on"+evnt, func); }else{ // No much to do elem[evnt] = func; } } // Events addEvent("click", document.getElementById("next"), function(){ next(); }); addEvent("click", document.getElementById("prev"), function(){ prev(); }); addEvent("click", document.getElementById("r1"), function(){ EB.clickthrough("url1"); }); addEvent("click", document.getElementById("r2"), function(){ EB.clickthrough("url2"); }); addEvent("click", document.getElementById("r3"), function(){ EB.clickthrough("url3"); }); addEvent("click", document.getElementById("r4"), function(){ EB.clickthrough("url4"); }); addEvent("click", document.getElementById("r5"), function(){ EB.clickthrough("url5"); }); var isRunning = false; // Flag to stop carousel spam var autoRotate = setInterval(next, 5000); // Automatic carousel rotation function prev(){ clearInterval(autoRotate); if(isRunning == false){ isRunning = true; var parentElement = document.getElementById("carousel"); parentElement.insertBefore(parentElement.childNodes[3],parentElement.childNodes[0]); TweenMax.to(".carousel", 0.0, {x:"-=300"}); TweenMax.to(".item", 0.5, {x:"+=300"}); setTimeout(function(){ isRunning = false; }, 500); } autoRotate = setInterval(next, 5000); // Restart the auto-rotate } function next(){ clearInterval(autoRotate); var parentElement = document.getElementById("carousel"); if(isRunning == false){ isRunning = true; TweenMax.to(".carousel", 0.5, {x:"-=300"}); TweenMax.delayedCall(0.5, function(){ TweenMax.to(".item", 0.0, {x:"+=300"}); var cln = parentElement.childNodes[0].cloneNode(true); parentElement.appendChild(cln); parentElement.removeChild(parentElement.childNodes[0]); isRunning = false; }); } autoRotate = setInterval(next, 5000); }
×
×
  • Create New...