Home › Forums › JavaScript › Syntax Error
- This topic is empty.
-
AuthorPosts
-
June 7, 2012 at 4:13 pm #38411Historical Forums UserParticipant
Where have I gone wrong? I get a syntax error as noted below. I really know very little about js, but I’m using Chris et al’s Anything slider. Everything was working fine until I tried to add some video configuration code, but some syntax error that I can’t figure out is messing things up. I think I’m missing a closing } or something. Help?
// Set up Sliders
// **************
$(function(){
$('#slider1').anythingSlider({
mode : 'f',
resizeContents : false,
navigationSize : 20,
navigationFormatter : function(index, panel){
return [index - 4];
},
onSlideBegin: function(e,slider) {
// keep the current navigation tab in view
slider.navWindow( slider.targetPage );
//video
resumeOnVideoEnd : true,
resumeOnVisible : true, //**ERROR ON THIS LINE**
addWmodeToObject : "opaque",
isVideoPlaying : function(base){ return false; }
}
});June 7, 2012 at 4:41 pm #104068karlpcrowleyParticipantHey, try this
$(function() {
$('#slider1').anythingSlider({
mode: 'f',
resizeContents: false,
navigationSize: 20,
navigationFormatter: function(index, panel) {
return [index - 4];
},
onSlideBegin: function(e, slider) {
// keep the current navigation tab in view
slider.navWindow(slider.targetPage);
//video
resumeOnVideoEnd = true;
resumeOnVisible = true;
//**ERROR ON THIS LINE**
addWmodeToObject = "opaque";
isVideoPlaying = function(base) {
return false;
};
}
});
});June 7, 2012 at 5:07 pm #104069Historical Forums UserParticipantThanks, karl, but it had no effect.
June 7, 2012 at 5:32 pm #104070karlpcrowleyParticipantHmm, how about this
$(function() {
$('#slider1').anythingSlider({
mode: 'f',
resizeContents: false,
navigationSize: 20,
resumeOnVideoEnd: true,
resumeOnVisible: true,
addWmodeToObject: "opaque",
navigationFormatter: function(index, panel) {
return [index - 4];
},
onSlideBegin: function(e, slider) {
slider.navWindow(slider.targetPage);
},
isVideoPlaying: function(base) {
return false;
}
});
});June 7, 2012 at 7:51 pm #104078Historical Forums UserParticipantNo dice :(
June 8, 2012 at 10:17 am #104100Taufik NurrohmanParticipantI tried to detect your error code with JSFiddle’s JSLint:
Extra comma:
return
And some unclosed function.
How about this:// Set up Sliders
// **************
$(function() {
$('#slider1').anythingSlider({
mode: 'f',
resizeContents: false,
navigationSize: 20,
navigationFormatter: function(index, panel) {
return [index - 4];
},
onSlideBegin: function(e, slider) {
// keep the current navigation tab in view
slider.navWindow(slider.targetPage);
},
resumeOnVideoEnd: true,
resumeOnVisible: true,
addWmodeToObject: "opaque",
isVideoPlaying: function(base) {
return false;
}
});
});June 13, 2012 at 11:22 pm #104351Michael_bondsMemberTry to put the closing parenthesis after the second to last curly brace. Also looks like you might have an extra comma with in the array that is being returned.
I hope that helped!
-Mike
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.