?
Solved

JQuery Slide Effect on Anchor Click

Posted on 2011-02-20
3
Medium Priority
?
1,067 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 2000 total points
ID: 34938217
     $(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
ID: 34938219
0
 

Author Closing Comment

by:error77
ID: 34938982
THanks a million :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

743 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