Change bce.js to:
Code:
$(function() {
selection = 0;
setInterval(get_width,100);
changeit(0);
});
$(document).on('click','#nav>li',function (){
//selection = $(this).index();
//$('.selected').switchClass('selected','not',100);
//$(this).switchClass('not','selected',100);
changeit(1);
});
function get_width(){
var change = $('body').width()-$('#nav').outerWidth(true)-10;
$('#outline>li:eq(1)').width(change);
};
function changeit(value){
$('#nav>li').removeClass('selected').addClass('not');
$('#nav>li:eq('+value+')').removeClass('not').addClass('selected');
$('#developer').text(value);
};
In get_width() there was an undeclared global var change which was overwriting the function change after it was used the first time (100ms after document ready). By declaring the change var formally in the function and changing the function change()'s name to changeit, the conflict is avoided. Either of these actions alone should suffice to fix the problem. But I did both, just to be on the safe side.
Further, the change (now changeit) function had an error - the_value - was undefined. I changed that to value to avoid that error.
Bookmarks