Skip to content Skip to sidebar Skip to footer

Converting Jquery To Javascript

Sorry, I am am very poor at JQuery. I got one code for my requirement which is Jquery. Can any one please convert it into plain javascript $(window).scroll(function() { var scr

Solution 1:

I'm guessing that maybe this is what you want:

http://jsfiddle.net/fuJbh/

window.addEventListener('scroll', function() {
    var scrollTop = window.pageYOffset;
    document.getElementById('worklist').style.bottom = -scrollTop + "px";
});​

This will keep your link at the bottom of the page.

Hope this helps!

Andy.

Solution 2:

Off the top of my head, something like this:

window.addEventListener('scroll', function() {
    var scrollTop = window.pageYOffset;
    document.getElementById('mybox').style.top = scrollTop;
});

Solution 3:

The equivalent JavaScript for getting window's scroll event is

window.onscroll = function()

{

// Here write what you want to do when you scroll.

}

Post a Comment for "Converting Jquery To Javascript"