I've been pulling my hair out with this. We have an implementation of bxslider in a SharePoint 2013 home page. This work was completed by my now departed collegue, so not my work, but .... it was finished and working.
Now though I get a runtime error when calling onSliderLoad callback function which calls slider.goToNextSlide();
Extract from Debug Output window VS: 0x800a138f - JavaScript runtime error: Unable to get property 'goToNextSlide' of undefined or null reference
I've pretty much ruled out a code change because I've reverted the source code back months and also restored a very old snapshot into the virtual SharePoint server. These all still experience the same new issue. I also tried this trick on our staging server which hasn't had any newly released code for a while. This host is now experiencing the same issue. Only thing I can think is that there is a external change which is causing this issue, but what I have no idea.
I get different errors from Firebug and IE10 (It's SharePoint you have to test and debug in IE as well ;-))
Extract from FeedsRotator.ascx (Webpart on Home.aspx)
var slider= $('#slider2').bxSlider({
auto: true,
controls: false,
pager:false,
pause: 10000,
slideWidth: (sir ? sirina:300),
slideHeight: 450,
randomStart: true,
autoHover: true,
onSliderLoad: function (currentIndex) {
slider.goToNextSlide(); //This is line 1024
},
Extract from BxSlider.css
#slider1 {
margin:0;
padding:0;
}
.bx-wrapper {
position: relative;
margin: 10px;
padding: 0;
*zoom: 1;
}
.bx-wrapper img {
max-width: 100%;
display: block;
}
Forgot to say we're using jquery 1.9.1.