- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Navigation Not Working in IE8
I’m using Anthingslider to make a sort of e-book, where each page is a list item and it all slides using arrows at the sides of the page (technically, I’m using in5, which converts my InDesign file into HTML, but at this point I’m up to my elbows in code, so I’m taking some credit here).
My book has internal navigation – click a button and you’ll go directly to that page. It uses an onclick that calls nav.to(n), and it works great in Firefox and Safari. IE8, on the other hand, will slide left and right, one page at a time, but it doesn’t do anything with the direct navigation. It’s ignoring the nav.to(n) functionality entirely.
The whole page is enormous, and it would just be rude to upload it all here. But here is the script from the HTML doc that references the nav element:
if($.hasOwnProperty(‘scrollTo’)){
nav = { numPages:$(‘.pages .page’).length,
back:function(ref){var targ=$(ref).parent(‘.page’).prev()[0]; if(targ!=undefined); $.scrollTo(targ, 500);},
next:function(ref){var targ=$(ref).parent(‘.page’).next()[0]; if(targ!=undefined); $.scrollTo(targ, 500);},
first:function(){$.scrollTo($(‘.page’)[0], 500)},
last:function(){$.scrollTo($(‘.page’)[nav.numPages-1], 500)},
to:function(n){$.scrollTo($(‘.page’)[n-1], 500)} };
}
And here is a button calling that function:
Any help would be appreciated.
Sorry, there’s also this piece of code in the anythingslider settings:
nav = {
numPages:slider.pages,
current:slider.currentPage,
next:function(){slider.goForward();},
back:function(){slider.goBack();},
first:function(){this.to(1);},
last:function(){this.to(this.numPages)},
to:function(n){slider.gotoPage(n);}
};