18
<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

1

1 Answer 1

5

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);
});

Not the answer you're looking for? Browse other questions tagged or ask your own question.