You must Sign In to post a response.
  • Category: ASP.NET

    How to bottom to top in

    i am working in the bootstrap with . my child form is 'content'. i am trying this following coding. I want when page is gone buttom
    the bottom to top image display and when i press that image my page should go top.

    <asp:Content ID="Content1" ContentPlaceHolderID="cHead" runat="Server">
    <link href="Style/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="Style/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <script src="Script/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Script/jquery-1.4.1.js" type="text/javascript"></script>
    <link rel="stylesheet" href="" />
    <script type="text/javascript">
    $(document).ready(function () {
    //Hide Back to top button
    $(window).scroll(function () {
    if ($(window).scrollTop() > 200) {
    } else {
    $('#back-to-top img').click(function () {
    scrollTop: 0
    }, 1000);
    <style type="text/css">
    position: fixed;
    bottom: 30px;
    top: 350px;
    #back-to-top img
    cursor: pointer;
    <asp:Content ID="Content2" ContentPlaceHolderID="mBody" runat="Server">
    <!-- /navbar -->
    Back To Top Demo by Nitesh Luharuka</h1>
    <div class="container" style="height: 1000px">
    <span id="back-to-top">
    <img alt="" src="Image/Arrow-Up.png" /></span>
  • #766261
    Everything looks fine except one line i.e. $('body').animate({ scrollTop: 0 }, 1000);
    Just replace it with this one:

    $('html,body').animate({ scrollTop: 0 }, 1000);

    * Just added 'html' keyword so that it will animate whole html contents.

  • Sign In to post your comments