tags:

views:

35

answers:

3

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"

A: 

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
+1  A: 

You can use # as "URL":

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

No JavaScript required.

Felix Kling
i want to make it go smoot
You mean it should scroll to the top?
Felix Kling
+1  A: 
$(function() {
    $('a#top').click(function() {
        $('html,body').animate({'scrollTop' : 0},1000);
    });
});

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

Ninja Dude