Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder StealthRT's Avatar
    Join Date
    Aug 2006
    Posts
    187
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Exclamation Using a link inside javascript

    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..
    Code:
    <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?:
    Code:
    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

  • #2
    Regular Coder StealthRT's Avatar
    Join Date
    Aug 2006
    Posts
    187
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Ahh yes! i just now got it working!!!

    i used this:
    Code:
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •