Akash
Akash

Reputation: 295

Enscroll js scrollbar

I have used "enscroll" js scroll bar in my page. http://enscrollplugin.com/#demos

<div id="enscroll_name">
    <ul>
    <li id="p1">product1</li>
    <li id="p2">product2</li>       
    <li id="p3">product3</li>
    <li id="p4">product4</li>
    <li id="p5">product5</li>
    </ul>
 </div>

On Page load the product3 need to be in the visible area. I used <a name="p3"></a> for this. But in query how to achieve this? In html we used anchor name tag like <a name="p3"></a>. But in this script how to achieve this?

Upvotes: 0

Views: 1870

Answers (1)

Jay
Jay

Reputation: 137

You can use .scrollTop() jquery function to visible whatever the area that you want inside the div. Try like this..

$('#yourdiv').scrollTop($("p[name='p2']").height());

Check the sample fiddle

Upvotes: 2

Related Questions