Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Alter Carousel Script for Next Previous
Old 02-11-2009, 05:58 AM Alter Carousel Script for Next Previous
Extreme Talker

Posts: 199
Trades: 0
I'm trying to slightly alter the script found here, http://www.adrianhodge.com/web-desig...iv-slider-121/.

What i want to do is make the carousel work on a Next/Previous feature versus a 1, 2, 3 method. I tried to do it myself but found i was was just going in circles and nothing was working. Any help is appreciated. I have listed below the only parts that should matter.

Javascript
Code:
<script language="Javascript">
<!--
function slideFolio(col){
    var x = ((col-1)*-505)
    var folioChange = new Fx.Tween('folio', {duration:2000});
    folioChange.start('left',x);
    var cur = "trigger"+col;
    $(cur).addClass('current');

    for (i=1;i<=8;i++){
        var loopLI = "trigger"+i;
        if (cur==loopLI){}else{
            $(loopLI).removeClass('current');
        }
    }
}
//-->
</script>
HTML
Code:
<ul class="nums">
<li id="trigger1" class="current"><a href="javascript:slideFolio(1);" class="liinternal">1</a></li>
<li id="trigger2"><a href="javascript:slideFolio(2);" class="liinternal">2</a></li>
<li id="trigger3"><a href="javascript:slideFolio(3);" class="liinternal">3</a></li>
</ul>
empiresolutions is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-11-2009, 07:38 AM Re: Alter Carousel Script for Next Previous
Extreme Talker

Posts: 199
Trades: 0
Solution:

JavaScript
Code:
<script language="Javascript">
<!--
var col=1; // always 1
var colMin=1; // always 1
var colMax=7; // max columns

function slideFolio(direction){

    if (direction=='p' && col > 0) { col = col - 1; }
    if (direction=='n') { col = col + 1; }

    if (col > colMax) { col = colMin; }
    else if (col < colMin) { col = colMax; }

    var x = ((col-1)*-505);
    var folioChange = new Fx.Tween('folio', {duration:2000});
    folioChange.start('left',x);
}
//-->
</script>
HTML
Code:
<a href="javascript:slideFolio('p');">Previous</a></li>
<a href="javascript:slideFolio('n');">Next</a></li>
empiresolutions is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Alter Carousel Script for Next Previous
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.39215 seconds with 12 queries