SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make button to start this script?

    I want to make a button to start a script of JQuery SmoothDivScroll. The script is:

    <script type="text/javascript">
    $(window).load(function() {
    $("div#makeMeScrollable").smoothDivScroll({
    autoScroll: "onstart" ,
    autoScrollDirection: "backandforth",
    autoScrollStep: 1,
    autoScrollInterval: 15,
    startAtElementId: "startAtMe",
    visibleHotSpots: "always"
    });
    });
    </script>

    Now I don't know how to make the onclick code of the button to start this script: <input type="button" onclick="??" />

    Can somebody help?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Kippie2 View Post
    Now I don't know how to make the onclick code of the button to start this script
    Their lab page provides examples of how.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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