Joined July 2012
·

Phil Renaud

Developer/Designer at Affin.io
Developer/Designer
Affin.io
·
Halifax, Nova Scotia, Canada
·
·
·

Hi gehwissenlos - this code should be placed within a scroll function,

On riotindustries.com for example, I'm doing this:

$(window).scroll(function(i){
    var scrollVar = $(window).scrollTop();
    $('section#about .inner').children('h2').css({'top': .7*scrollVar });
    $('section#about .inner').children('h2').css({'opacity':( 100-scrollVar )/100});
})

If you're doing this from an editor to a webpage, maybe have this triggered on a focus() event of the page in question?

Achievements
343 Karma
23,123 Total ProTip Views