Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page onload auto smooth scrolling

    Hello,
    I need help to make script, which could use mootools, jQuery, or something like that for page onload automatic smooth scrolling after set time. I make this code:

    <script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
    <script type="text/javascript">
    window.addEvent('domready',function() {
    new Fx.SmoothScroll({
    setTimeout("location.href = '#info';",7000)
    duration: 500
    },window);
    });
    </script>

    But it doesn't work, because my JavaScript knowledge isn't so well yet.
    Thank you before, greetings Tomas.

  • #2
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found this solution:
    Code:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script rel="javascript" type="text/javascript">
    $(window).bind("load", function() {
    				setTimeout(function(){
            var urlHash = window.location.href.split("#")[1];
       					$('html,body').animate({scrollTop:$('#info').first().offset().top}, 1200);
        }, 7000);
    });
    </script>
    If someone would like to use it .


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •