• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1081
  • Last Modified:

JQuery Slide Effect on Anchor Click

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
error77
Asked:
error77
  • 2
1 Solution
 
Gurvinder Pal SinghCommented:
     $(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
 
Gurvinder Pal SinghCommented:
0
 
error77Author Commented:
THanks a million :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now