Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Syntax Error

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #38411

    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; }

    }

    });

    #104068
    karlpcrowley
    Participant

    Hey, 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;
    };

    }

    });
    });​
    #104069

    Thanks, karl, but it had no effect.

    #104070
    karlpcrowley
    Participant

    Hmm, 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;
    }
    });
    });​
    #104078

    No dice :(

    #104100
    Taufik Nurrohman
    Participant

    I 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;
    }
    });
    });
    #104351

    Try 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.