0

how to make page up link

i have to make link in my site when user click it shows a top view of site "i mean it goes to header of my site"

Nikita Rybak
  • 66,340
  • 22
  • 154
  • 177

3 Answers3

3

You can use # as "URL":

<a href="#"> Go Up <a/>

No JavaScript required.

Felix Kling
  • 756,363
  • 169
  • 1,062
  • 1,111
1
$(function() {
    $('a#top').click(function() {
        $('html,body').animate({'scrollTop' : 0},1000);
    });
});

Test it here : http://jsbin.com/ucati4

0

What about giving your header some id (e.g., 'header') and making a link to it (<a href="#header">go up</a>)? Simple enough.

Nikita Rybak
  • 66,340
  • 22
  • 154
  • 177