Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Error on my parallax javascript

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #190408
    mika
    Participant

    I’m building this parallax site (testi4.aada.fi) with code i found from UNTAME
    (http://untame.net/2013/04/how-to-integrate-simple-parallax-with-twitter-bootstrap/).

    Here is the code they say that works, but i got error on dreamweaver.

    <script type=”text/javascript”>
    $(document).ready(function(){
    // cache the window object
    $window = $(window);

    $(‘section[data-type=”background”]’).each(function(){
    // declare the variable to affect the defined data-type
    var $scroll = $(this);

      $(window).scroll(function() {
        // HTML5 proves useful for helping with creating JS functions!
        // also, negative value because we're scrolling upwards                            
    

    This line gets syntax error on dreamweaver

    var yPos = -(($window.scrollTop() – $scroll.offset().top) / $scroll.data(‘speed’));


        // background position
        var coords = '50% '+ yPos + 'px';
    
        // move the background
        $scroll.css({ backgroundPosition: coords });   
      }); // end window scroll
    

    }); // end section function
    }); // close out script

    /* Create HTML5 element for IE */
    document.createElement(“section”);
    </script>

    Can some help me out with this?

    // Mika

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.