Hey guys and gals,
Does anyone know why my conditional is not working on the sub-pages? The desktop version works fine (when you click on the nav links, it brings up the index page, animates, then takes you to the linked page), but the tablet and phone versions are not supposed to animate, but go straight to the page?
To my eye everything looks fine? HELP!
Since the jQuery is minified, here is the code for the sub-pages:
$(document).ready(function() {
var button = $('nav ul').children().find('a');
if (document.width <= 768) {
$.ajax(button.click(function() {
$(this).abort();
}));
} else {
$.ajax(button.click(function(e){
e.preventDefault();
var linkLocation = this.href;
var pos = $(this).data('pos');
$('html').load("index.php", function(data){
$(this).find('div.bg img, div nav ul#mainNav').animate(pos, 500);
cache: false,
$('html').delay(900).fadeOut(1500, function redirect(){
location = linkLocation;
});
});
}));
$(window).on('pageshow',function(){
$("div.bg img, div nav ul#mainNav, body").removeAttr('style');
});
}
});
Casey Baggz