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
  • #190408

    I’m building this parallax site ( with code i found from UNTAME

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

    <script type=”text/javascript”>
    // cache the window object
    $window = $(window);

    // 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) / $‘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 */

    Can some help me out with this?

    // Mika

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