I have a JQuery event that i would like to repeat for each time to the mouse is scrolled. Currently it will run once, add the css and then seemingly become completely inactive.
I'm just learning JQuery, i originally was using .scroll but that would not apply the css even once so am no using .bind with the mousewheel. I've tried a .onclick event but this does the same and i don't really know what else to try.
$(document).ready(function () {
$(window).bind('mousewheel', function() {
$(".perspective-line p").css({
transform: 'translate(0, -50px)',
});
});
});
my text is transformed once by 50px but then it is just stuck there and i want it to transform again when the mousewheel is scrolled.
edit* new script
$(document).ready(function () {
var increasedValue = 0;
$(window).bind('mousewheel', function() {
increasedValue += 50;
$(".perspective-line p").css({
transform: 'translate(0, -${increasedValue}px)',
});
console.log(increasedValue)
});
});