...

View Full Version : Using a link inside javascript



StealthRT
12-14-2007, 04:36 AM
Hey everyone i have a quick question here... I'm using some code from http://www.ndoherty.com/demos/coda-slider/1.1.1/ called coda-slider. In order to slide from one DIV to another u us a link like so..


<p><a href="#2" class="cross-link">Next</a></p>

In the above code, the link would take you to the 2nd DIV.

Now my question is, how can i do that same thing but inside javascript with my code below?:


function Step1()
{
if (Checkit1())
{
//location.href='#2';
}
else
{
return false;
}
}

I've tryed the location.href='#2'; but it only changes the URL which doesnt move the box from DIV 1 to DIV 2 as the link would.

Any help would be great! :)
David

StealthRT
12-14-2007, 08:12 AM
Ahh yes! i just now got it working!!! :)

i used this:


jQuery().find("div.panelContainer").animate({ left: -1024}, 750, "expoinout");

the {left: -xxxx} is the position (cnt) of the frame after it slides... so mine is in 1024x768 so the first tab = 0, the second = 1024, the third = 2048, etc etc. The 750 and "expoinout" are better know as settings.easeTime & settings.easeFunc which are the default values already in place, i just had to include them so it would know what to do.

David



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum