1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Trying to install script - help with install directions

Discussion in 'JavaScript' started by chrisj, Jul 21, 2016.

  1. #1
    I'm trying to install this on an html page. The ReadMe instructions are short, but beyond my skill set. I'm fairly familiar with html and php. Could you try to explain what is being asked here, for me?

    "The style of scroll effect is determined via the class that is set on the list. Once the class is set, stroll.js needs to be told to monitor that list via the bind method:

    ```javascript
    // Bind via selectors
    stroll.bind( '#main ul' );
    Code (JavaScript):
    // Bind via element reference
    stroll.bind( document.getElementById( 'some-list' ) );
    Code (JavaScript):
    // Bind via array of elements / jQuery object
    stroll.bind( $( '#main .some-list' ) );
    Code (JavaScript):
    Any help will be appreciated.
     
    chrisj, Jul 21, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    What that says is that for the javascript to work, you first need to load it onto the page (in the <head>, with a call to <script>). Then you need to enable it for the elements you want to use it on.

    If you for instance want to use it on an <ul> with the id="something", and you already use jQuery on your page, you can use the last example, just change it to
    
    stroll.bind($('#something'));
    
    Code (markup):
    If you're only using plain javascript, the second (document.getElementById) is appropriate to use:
    
    stroll.bind(document.getElementById('something'));
    
    Code (markup):
    and so forth.

    But, to be able to use these, you have to have already loaded the javascript correctly into the page, and put these either into an external javascript file you load last, or in a <script>-tag in the <head>-section.
     
    PoPSiCLe, Jul 21, 2016 IP
  3. chrisj

    chrisj Well-Known Member

    Messages:
    606
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    thanks
     
    chrisj, Aug 19, 2016 IP