Enjoy an ad free experience by logging in. Not a member yet? Register.
|
|
Results 1 to 2 of 2
Thread: JQuery syntax error
-
04-11-2016, 05:18 AM #1New to the CF scene
- Join Date
- Mar 2016
- Posts
- 3
- Thanks
- 0
- Thanked 0 Times in 0 Posts
JQuery syntax error
I'm trying to use JQuery to do a very simple parallax effect and the console keeps telling me: Uncaught SyntaxError: Unexpected token )
I've tried to figure out what it means and I just don't see where an extra ) is. Here is the code:
$(window).scroll(function(){
var wScroll = $(this).scrollTop();
$('.title').css({
'transform' : 'translate(0px, '+ wScroll /2 +'%')'
});
});
-
04-11-2016, 08:50 AM #2Senior Coder
- Join Date
- Jan 2010
- Location
- Behind the Wall
- Posts
- 4,556
- Thanks
- 14
- Thanked 476 Times in 471 Posts
let’s have a look at the offender with code highlighting:
the colouring should point out the issue JS is complaining about.PHP Code:'transform' : 'translate(0px, '+ wScroll /2 +'%')'
The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.André Behrens, NY Times Software Developer



Reply With Quote
