click to scroll up

Discussion in 'HTML & Website Design' started by drew68, Nov 7, 2011.

  1. #1
    drew68, Nov 7, 2011 IP
  2. XeBii

    XeBii Peon

    Messages:
    77
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Here's your Scroll To Top Script:

    The Javascript
    
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js' type='text/javascript'></script>
    <script src='http://geeksvisioncdn.appspot.com/files/jquery.ui.totop.js' type='text/javascript'></script>
    <script type='text/javascript'>
    $(document).ready(function(){ $().UItoTop({ easingType: 'easeOutCubic' }); });
    </script>
    HTML:
    The CSS
    #w2btoTop {display:none;text-decoration:none;position:fixed;bottom:10px;right:10px;overflow:hidden;width:51px;height:51px;border:none;text-indent:-999px;background:url([url]http://2.bp.blogspot.com/-oVa1ImctF7c/Tdouv3K7NyI/AAAAAAAAA38/xT4bu8uKM3M/way2blogging.org.ui.totop.png[/url]) no-repeat left top;}#w2btoTopHover {background:url([url]http://2.bp.blogspot.com/-oVa1ImctF7c/Tdouv3K7NyI/AAAAAAAAA38/xT4bu8uKM3M/way2blogging.org.ui.totop.png[/url]) no-repeat left -51px;width:51px;height:51px;display:block;overflow:hidden;float:left;opacity: 0;-moz-opacity: 0;filter:alpha(opacity=0);}#w2btoTop:active, #w2btoTop:focus {outline:none;}
    HTML:
    Just add both the JavaScript and CSS on any Html Page you want to Have Scroll To Top Functionality
     
    XeBii, Nov 8, 2011 IP
  3. Toycel

    Toycel Peon

    Messages:
    243
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    0
    #3
    You don't need a script just use the inpage linking.

    <a herf="#top"> and <a name="top">
    Code (markup):
     
    Toycel, Nov 9, 2011 IP