{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/1f9fc80df679a768c5c6aef561ac40ba?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"1f9fc80df679a768c5c6aef561ac40ba","url":"https://api.github.com/users/clicktravel-sukhwant","login":"clicktravel-sukhwant","id":861316},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-03T13:36:43Z","comments":3,"closed_at":null,"url":"https://api.github.com/repos/ProLoser/AnythingSlider/issues/209","body":"\r\nHi All,\r\n\r\nI have constructed an anythingSlider with 4 tabs contain 4 embedded youtube videos and a bit of text below them. \r\nEverything seems to be working fine, the slides all work, the videos pause and play when a tab is slide too, etc\r\n\r\nHowever I've noticed a js error occuring whenever I slide a tab...\r\n\r\nbase.navWidth[i-1] is undefined  (Line 308) in jquery.anythingslider.js\r\n\r\nThis is my setup:-\r\n\r\njs/jquery-1.6.4.min.js\r\n<script>$j = jQuery.noConflict();</script>   \r\njs/jquery.easing.1.2.js\r\njs/swfobject.js\r\njs/jquery.anythingslider.js\r\njs/jquery.anythingslider.video.min.js\r\n\r\nMy anythingSlider definition is\r\n\r\n         <script type=\"text/javascript\">\r\n              \r\n            if ( window.XMLHttpRequest )    // Dont do this for IE6          \r\n            {\r\n              $j(function(){\r\n            \r\n                $j('#sliderFeatures').anythingSlider({ \r\n\t\t\t\t  toggleArrows        : true,\r\n\t\t\t\t  infiniteSlides      : false,\r\n\t\t\t\t  navigationFormatter : function(index, panel){\r\n\t\t\t\t\treturn ['test feature 1', 'test feature 2', 'test feature 3', 'test feature 4'][index - 1];\r\n\t\t\t\t  },\r\n\t\t\t\t  navigationSize      : 4,\t\t\t\t  \r\n\t\t\t\t  onSlideComplete: function(slider) {\r\n\t\t\t\t\t// keep the current navigation tab in view\r\n\t\t\t\t\tslider.navWindow( slider.currentPage ); \r\n\t\t\t      }                                                            \r\n                });\r\n              });\r\n            }\r\n          </script>\r\n\r\nI've currently suppressed the error by adding this into jquery.anythingslider.js\r\n\r\n\t\tbase.navWidth = function(x,y){\r\n\t\t\tvar i, s = Math.min(x,y),\r\n\t\t\t\te = Math.max(x,y),\r\n\t\t\t\tw = 0;\r\n\t\t\tfor (i = s; i < e; i++) {\r\n\t\t\t  if (typeof base.navWidth[i-1] != \"undefined\")  // <= check if it's defined first\r\n\t\t\t  {\r\n\t\t\t\tw += base.navWidths[i-1] || 0;\r\n\t\t\t  }\r\n\t\t\t}\r\n\t\t\treturn w;\r\n\t\t};\r\n\r\nOn initialisation the JS seems to run through \r\n\r\n- base.buildNavigation function, \r\n- into the (o.buildNavigation && (base.pages > 1)) IF, \r\n- skips the (o.navigationSize !== false && parseInt(o.navigationSize,10) < base.pages) IF - this is where base.navWidths variable is defined!?\r\n\r\nDuring a slide \r\n\r\nbase.navWidth is called from base.navWindow and errors on the w += base.navWidths[i-1] || 0; statement. The anythingSlider still works I just keep getting the js errors. Seems to me it's running through code it doesn't need to?\r\n\r\nDon't know enough about how everything else works in anythingSlider to get to the bottom of it.\r\n\r\nAny help appreciated! :)\r\n","html_url":"https://github.com/ProLoser/AnythingSlider/issues/209","title":"JS Error \"base.navWidth[i-1] is undefined","number":209,"id":2131897,"created_at":"2011-11-03T12:26:30Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/1f9fc80df679a768c5c6aef561ac40ba?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"1f9fc80df679a768c5c6aef561ac40ba","url":"https://api.github.com/users/clicktravel-sukhwant","login":"clicktravel-sukhwant","id":861316},"updated_at":"2011-11-03T13:36:43Z","url":"https://api.github.com/repos/ProLoser/AnythingSlider/issues/comments/2616965","body":"1 video in four tabs....\r\n\r\nmy JSFiddle setting are...\r\n\r\nHTML\r\n<ul id=\"slider\">\r\n    \r\n    <li>\r\n        <div>                                                         <object width=\"665\" height=\"350\">                       <param name=\"movie\" value=\"http://www.youtube.com/v/beCYGm1vMJ0?version=3&amp;hl=en_US\"></param>                       <param name=\"allowFullScreen\" value=\"true\"></param>                       <param name=\"allowscriptaccess\" value=\"always\"></param>                       <embed allowfullscreen=\"true\" width=\"665\" height=\"350\" allowscriptaccess=\"always\" type=\"application/x-shockwave-flash\" src=\"http://www.youtube.com/v/beCYGm1vMJ0?version=3&amp;hl=en_US\"></embed>                     </object>                                                               <div class=\"sliderDescPanel\">                      <h5>test</h5>                                        <p>test</p>                     <p>Release Date: 2011-10-08</p>                   </div>                 </div>\r\n    </li>\r\n    \r\n    <li>\r\n        <div>                                                         <object width=\"665\" height=\"350\">                       <param name=\"movie\" value=\"http://www.youtube.com/v/BcgDzWR19iA?version=3&amp;hl=en_US\"></param>                       <param name=\"allowFullScreen\" value=\"true\"></param>                       <param name=\"allowscriptaccess\" value=\"always\"></param>                       <embed allowfullscreen=\"true\" width=\"665\" height=\"350\" allowscriptaccess=\"always\" type=\"application/x-shockwave-flash\" src=\"http://www.youtube.com/v/BcgDzWR19iA?version=3&amp;hl=en_US\"></embed>                     </object>                                                               <div class=\"sliderDescPanel\">                      <h5>Staging test feature</h5>                                        <p>Staging test feature</p>                     <p>Release Date: 2011-10-08</p>                   </div>                 </div>\r\n    </li>\r\n    \r\n    <li>\r\n        <div>                                                         <object width=\"665\" height=\"350\">                       <param name=\"movie\" value=\"http://www.youtube.com/v/nxA0a5G6ccg?version=3&amp;hl=en_US\"></param>                       <param name=\"allowFullScreen\" value=\"true\"></param>                       <param name=\"allowscriptaccess\" value=\"always\"></param>                       <embed allowfullscreen=\"true\" width=\"665\" height=\"350\" allowscriptaccess=\"always\" type=\"application/x-shockwave-flash\" src=\"http://www.youtube.com/v/nxA0a5G6ccg?version=3&amp;hl=en_US\"></embed>                     </object>                                                               <div class=\"sliderDescPanel\">                      <h5>test feature 2</h5>                                        <p>test feature 2</p>                     <p>Release Date: 2011-10-08</p>                   </div>                 </div>\r\n    </li>\r\n    \r\n    <li>\r\n        <div>                                                         <object width=\"665\" height=\"350\">                       <param name=\"movie\" value=\"http://www.youtube.com/v/hOSYiT2iG08?version=3&amp;hl=en_US\"></param>                       <param name=\"allowFullScreen\" value=\"true\"></param>                       <param name=\"allowscriptaccess\" value=\"always\"></param>                       <embed allowfullscreen=\"true\" width=\"665\" height=\"350\" allowscriptaccess=\"always\" type=\"application/x-shockwave-flash\" src=\"http://www.youtube.com/v/hOSYiT2iG08?version=3&amp;hl=en_US\"></embed>                     </object>                                                               <div class=\"sliderDescPanel\">                      <h5>test feature 1</h5>                                        <p>test feature 1</p>                     <p>Release Date: 2011-10-08</p>                   </div>                 </div>   \r\n    </li>   \r\n</ul>\r\n\r\n<!-- Add stylesheets here -->\r\n<link rel=\"stylesheet\" href=\"http://proloser.github.com/AnythingSlider/css/theme-metallic.css\">\r\n\r\n<!-- Older IE stylesheet, to reposition navigation arrows, added AFTER the theme stylesheet above -->\r\n<!--[if lte IE 7]>\r\n<link rel=\"stylesheet\" href=\"http://proloser.github.com/AnythingSlider/css/anythingslider-ie.css\" type=\"text/css\" media=\"screen\" />\r\n<![endif]-->\r\n\r\n\r\nJS settings\r\n$('#slider').anythingSlider({\r\n\r\n    // *********** Appearance ***********\r\n    // Theme name; choose from: minimalist-round, minimalist-square, metallic, construction, cs-portfolio\r\n    theme: 'default',\r\n    // If true, the entire slider will expand to fit the parent element\r\n    expand: false,\r\n    // If true, solitary images/objects in the panel will expand to fit the viewport\r\n    resizeContents: true,\r\n    // If true, all panels will slide vertically; they slide horizontally otherwise\r\n    vertical: false,\r\n    // Set this value to a number and it will show that many slides at once\r\n    showMultiple: false,\r\n    // Anything other than \"linear\" or \"swing\" requires the easing plugin\r\n    easing: \"swing\",\r\n\r\n    // If true, builds the forwards and backwards buttons\r\n    buildArrows: true,\r\n    // If true, builds a list of anchor links to link to each panel\r\n    buildNavigation: true,\r\n    // If true, builds the start/stop button\r\n    buildStartStop: true,\r\n\r\n    // Append forward arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null\r\n    appendFowardTo: null,\r\n    // Append back arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null\r\n    appendBackTo: null,\r\n    // Append controls (navigation + start-stop) to a HTML element (jQuery Object, selector or HTMLNode), if not null\r\n    appendControlsTo: null,\r\n    // Append navigation buttons to a HTML element (jQuery Object, selector or HTMLNode), if not null\r\n    appendNavigationTo: null,\r\n    // Append start-stop button to a HTML element (jQuery Object, selector or HTMLNode), if not null\r\n    appendStartStopTo: null,\r\n\r\n    // If true, side navigation arrows will slide out on hovering & hide @ other times\r\n    toggleArrows: true,\r\n    // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times\r\n    toggleControls: false,\r\n\r\n    // Start button text\r\n    startText: \"Start\",\r\n    // Stop button text\r\n    stopText: \"Stop\",\r\n    // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)\r\n    forwardText: \"&raquo;\",\r\n    // Link text used to move the slider back (hidden by CSS, replace with arrow image)\r\n    backText: \"&laquo;\",\r\n    // Class added to navigation & start/stop button (text copied to title if it is hidden by a negative text indent)\r\n    tooltipClass: 'tooltip',\r\n\r\n    // if false, arrows will be visible, but not clickable.\r\n    enableArrows: true,\r\n    // if false, navigation links will still be visible, but not clickable.\r\n    enableNavigation: true,\r\n    // if false, the play/stop button will still be visible, but not clickable. Previously \"enablePlay\"\r\n    enableStartStop: true,\r\n    // if false, keyboard arrow keys will not work for this slider.\r\n    enableKeyboard: true,\r\n\r\n    // *********** Navigation ***********\r\n    // This sets the initial panel\r\n    startPanel: 1,\r\n    // Amount to go forward or back when changing panels.\r\n    changeBy: 1,\r\n    // Should links change the hashtag in the URL?\r\n    hashTags: true,\r\n    // if false, the slider will not wrap\r\n    infiniteSlides: false,\r\n    // Details at the top of the file on this use (advanced use)\r\n    navigationFormatter: function(index, panel) {\r\n        // This is the default format (show just the panel index number)\r\n        return ['test', 'Staging test feature', 'test feature 2', 'test feature 1'][index - 1];\r\n    },\r\n    // Set this to the maximum number of visible navigation tabs; false to disable\r\n    navigationSize: 4,\r\n\r\n    // *********** Slideshow options ***********\r\n    // If true, the slideshow will start running; replaces \"startStopped\" option\r\n    autoPlay: false,\r\n    // If true, user changing slides will not stop the slideshow\r\n    autoPlayLocked: false,\r\n    // If true, starting a slideshow will delay advancing slides; if false, the slider will immediately advance to the next slide when slideshow starts\r\n    autoPlayDelayed: false,\r\n    // If true & the slideshow is active, the slideshow will pause on hover\r\n    pauseOnHover: true,\r\n    // If true & the slideshow is active, the  slideshow will stop on the last page. This also stops the rewind effect  when infiniteSlides is false.\r\n    stopAtEnd: false,\r\n    // If true, the slideshow will move right-to-left\r\n    playRtl: false,\r\n\r\n    // *********** Times ***********\r\n    // How long between slideshow transitions in AutoPlay mode (in milliseconds)\r\n    delay: 3000,\r\n    // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).\r\n    resumeDelay: 15000,\r\n    // How long the slideshow transition takes (in milliseconds)\r\n    animationTime: 600,\r\n    // How long to pause slide animation before going to the desired slide (used if you want your \"out\" FX to show).\r\n    delayBeforeAnimate: 0,\r\n\r\n    // *********** Callbacks ***********\r\n    // Callback before the plugin initializes\r\n    onBeforeInitialize: function(e, slider) {},\r\n    // Callback when the plugin finished initializing\r\n    onInitialized: function(e, slider) {},\r\n    // Callback on slideshow start\r\n    onShowStart: function(e, slider) {},\r\n    // Callback after slideshow stops\r\n    onShowStop: function(e, slider) {},\r\n    // Callback when slideshow pauses\r\n    onShowPause: function(e, slider) {},\r\n    // Callback when slideshow unpauses - may not trigger properly if user clicks on any controls\r\n    onShowUnpause: function(e, slider) {},\r\n    // Callback when slide initiates, before control animation\r\n    onSlideInit: function(e, slider) {},\r\n    // Callback before slide animates\r\n    onSlideBegin: function(e, slider) {},\r\n    // Callback when slide completes - no event variable!\r\n    onSlideComplete: function(slider) {\r\n        // keep the current navigation tab in view       \r\n        slider.navWindow(slider.currentPage);\r\n    },\r\n\r\n    // *********** Interactivity ***********\r\n    // Event used to activate forward arrow functionality (e.g. add jQuery mobile's \"swiperight\")\r\n    clickForwardArrow: \"click\",\r\n    // Event used to activate back arrow functionality (e.g. add jQuery mobile's \"swipeleft\")\r\n    clickBackArrow: \"click\",\r\n    // Events used to activate navigation control functionality\r\n    clickControls: \"click focusin\",\r\n    // Event used to activate slideshow play/stop button\r\n    clickSlideshow: \"click\",\r\n\r\n    // *********** Video ***********\r\n    // If true & the slideshow is active & a  youtube video is playing, it will pause the autoplay until the video is  complete\r\n    resumeOnVideoEnd: true,\r\n    // If your slider has an embedded object, the script will automatically add a wmode parameter with this setting\r\n    addWmodeToObject: \"opaque\",\r\n    // return true if video is playing or false if not - used by video extension\r\n    isVideoPlaying: function(base) {\r\n        return false;\r\n    }\r\n\r\n});\r\n\r\nCSS\r\n/*** Set Slider dimensions here! Version 1.7+ ***/\r\n/* added #slider li to make panels the same size in case \"resizeContents\" is false */\r\n#slider, #slider li {\r\n    width: 665px;\r\n    height: 500px;\r\n    list-style: none;\r\n}\r\n\r\nClick the slides...what the JS errors (Firefox Error Console)\r\n\r\n\r\n\r\n","id":2616965,"created_at":"2011-11-03T13:36:43Z"}}