16
<div id="slider">
    <div id="pro1"></div>
    <div id="pro2"></div>
    <div id="pro3"></div>
</div>

<div id="thumb">
    <a href="#pro1"> <img id="tpro1" src="projects/tpro5.jpg" style="height: 100%;"></a>
    <a href="#pro2"> <img id="tpro2" src="projects/tpro5.jpg" style="height: 100%;"></a>
    <a href="#pro3"> <img id="tpro3" src="projects/tpro5.jpg" style="height: 100%;"></a>
</div>

This is the code i worked with, when i click on the link it is just jumping to that div so i want some animated horizontal scroll to show that div

thanks

Cristiano Soares
  • 601
  • 1
  • 8
  • 19
W I Z A R D
  • 1,176
  • 2
  • 16
  • 42
  • 1
    This has been asked so many times: [jQuery scroll To Element](http://stackoverflow.com/q/6677035/1456376). You can adopt the answer here to also scroll horizontally. – insertusernamehere Sep 25 '13 at 17:19

1 Answers1

4

Did u solved the problem already?

look, i tried this and it worked for me so, i think it can work for u ;) Dont even need the element < a >

$("#thethingyougonnaclick").click(function() {
    $('html, body').animate({ scrollTop:$("#theelementidtoscroll").offset().top}, 500);
});
Mirelli
  • 56
  • 2