Saeed
Saeed

Reputation: 123

jquery mobile anchor link is not working

I'm trying to put an anchor link in my web page but when I click go to top link nothing happen. I'm using jquery mobile.

Code:

<div data-role="content">
      <a id="home_top">top</a>
      <ul id="home_index_ul" data-role="listview">
           <li>1</li>
           <li>2</li>
           <li>3</li>
           ...
      </ul>
      <a href="#home_top">go to top</a>
</div>

Upvotes: 2

Views: 673

Answers (1)

Greenhorn
Greenhorn

Reputation: 1700

Use .slientScroll

<a href="#" onclick="$.mobile.silentScroll(0)" data-role="button">go to Top</a>

Upvotes: 2

Related Questions