Solved

JQuery Slide Effect on Anchor Click

Posted on 2011-02-20
3
1,042 Views
Last Modified: 2012-05-11
Hi all,

I have some html DIV's (sections)...

What I want to do is using JQuery I want to slide (effect) from one to the other..

Example:

<div id="div-1">
Some text here
Some Text here
<a href="#div-2">Goto div-2</a> <!--When I click on this link I need it to Slider (horizontally to div-2-->
</div>

<div id="div-2">
Some other text here
Some other Text here
</div>


<div>

Hope someone can help

Thanks

0
Comment
Question by:error77
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
Comment Utility
     $(document).ready(function() {
        $('#div-1 span').click(function() {
          var $lefty = $("#div-2");
          $lefty.animate({
            left: -$lefty.outerWidth()
          });
        });
      });


<div id="div-1">
Some text here
Some Text here
<span>Goto div-2</span>
</div>
0
 
LVL 40

Expert Comment

by:gurvinder372
Comment Utility
0
 

Author Closing Comment

by:error77
Comment Utility
THanks a million :)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now