Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
22
rated 0 times [  25] [ 3]  / answers: 1 / hits: 38293  / 14 Years ago, tue, october 26, 2010, 12:00:00

I don't understand what I'm doing wrong here... line 3 is reporting missing : after property ID



$(document).ready(function() {

$('#imagegallery img').each(function({$(this).css({ width: '100%'});});

$('#imagegallery').cycle({
timeout: 0,
fx: 'scrollHorz',
width: '100%',
height: 'auto',
next: '.next',
prev: '.prev'
});



$(#imagegallery).touchwipe({
wipeLeft: function() {
$(#imagegallery).cycle(next);
},
wipeRight: function() {
$(#imagegallery).cycle(prev);
}
});
});

More From » jquery

 Answers
24

Problem is with this line:



$('#imagegallery img').each(function({$(this).css({ width: '100%'});});


should be:



    // missing ) --------------------v
$('#imagegallery img').each(function(){$(this).css({ width: '100%'});});


Although you can shorten it like this:



$('#imagegallery img').css({ width: '100%'});

[#95169] Saturday, October 23, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
austonjuancarlosb

Total Points: 238
Total Questions: 89
Total Answers: 99

Location: Chad
Member since Mon, Dec 5, 2022
1 Year ago
;