Sha256: 054e2f0bd111fc886d140b2019e968325b478727447c1115bd44bd192e302861

Contents?: true

Size: 827 Bytes

Versions: 34

Compression:

Stored size: 827 Bytes

Contents

$(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
            var yPos = -($window.scrollTop() / $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");

Version data entries

34 entries across 32 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.7 doc/source/static/js/scroll.js
foreman_remote_execution-1.3.6 doc/source/static/js/scroll.js
foreman_remote_execution-1.4.1 doc/source/static/js/scroll.js
foreman_remote_execution-1.3.5 doc/source/static/js/scroll.js
foreman_remote_execution-1.3.4 doc/source/static/js/scroll.js
foreman_remote_execution-1.3.3 doc/source/static/js/scroll.js
foreman_remote_execution-1.3.2 doc/source/static/js/scroll.js
foreman_remote_execution-1.3.1 doc/source/static/js/scroll.js
foreman_remote_execution-1.3.0 doc/source/static/js/scroll.js
foreman_remote_execution-1.2.2 doc/source/static/js/scroll.js
foreman_remote_execution-1.2.1 doc/source/static/js/scroll.js
foreman_remote_execution-1.2.0 doc/source/static/js/scroll.js
foreman_remote_execution-1.1.1 doc/source/static/js/scroll.js
foreman_remote_execution-1.1.0 doc/source/static/js/scroll.js
foreman_remote_execution-1.0.0 doc/source/static/js/scroll.js
foreman_remote_execution-0.3.2 doc/source/static/js/scroll.js
foreman_remote_execution-0.3.1 doc/source/static/js/scroll.js
foreman_remote_execution-0.3.0 doc/source/static/js/scroll.js
foreman_remote_execution-0.2.3 doc/source/static/js/scroll.js
foreman_remote_execution-0.2.2 doc/source/static/js/scroll.js