KennyP
12-31-2014, 11:32 AM
Hi guys, please one more request...
The following script that was written by J Scheuer use to work just great in all browsers to fade-out the content of a div on page unload and then fade-in the content of the equivalent div on another page load.
I recently noticed however that now it has an issue with the new Firefox... if you use the back button to return to the first page whose div content was faded out, the div/content remains hidden (as it was left on page un-load).
Can it be altered to deal with whatever changes were made in the browser? ---Thanks
The issue can be seen here (www.billyjoeconor.com/freebies/cell-savers/select.php) when navigating from the first set of 4 images to the second set of 4 images (which are on a different page in the equivalent div), and then returning to the first set by way of the browser's back button --- they no longer display, unless you refresh the page.
(function($){
$('head').append('<style type="text/css">#d1 {visibility: hidden;}</style>');
$(function(){
$('#d1').css({opacity: 0, visibility: 'visible'}).animate({opacity: 1}, 600, 'linear', function(){
if(typeof fleXenv === 'object' && typeof fleXenv.globalInit === 'function'){
fleXenv.globalInit();
}
if(this.style.getAttribute){
this.style.removeAttribute('filter');
}
});
});
(function(re){
$(document).click(function(e){
var t = e.target;
while (t.tagName && !re[0].test(t.tagName)){
t = t.parentNode || null;
}
if(t && t.tagName && !t.target || re[1].test(t.target)){
e.preventDefault();
$('#d1').animate({opacity: 0}, 600, 'linear', function(){
location = t.href;
});
}
});
})([/^(a|area)$/i, /^_(top|self|parent)$/]);
})(jQuery);
The following script that was written by J Scheuer use to work just great in all browsers to fade-out the content of a div on page unload and then fade-in the content of the equivalent div on another page load.
I recently noticed however that now it has an issue with the new Firefox... if you use the back button to return to the first page whose div content was faded out, the div/content remains hidden (as it was left on page un-load).
Can it be altered to deal with whatever changes were made in the browser? ---Thanks
The issue can be seen here (www.billyjoeconor.com/freebies/cell-savers/select.php) when navigating from the first set of 4 images to the second set of 4 images (which are on a different page in the equivalent div), and then returning to the first set by way of the browser's back button --- they no longer display, unless you refresh the page.
(function($){
$('head').append('<style type="text/css">#d1 {visibility: hidden;}</style>');
$(function(){
$('#d1').css({opacity: 0, visibility: 'visible'}).animate({opacity: 1}, 600, 'linear', function(){
if(typeof fleXenv === 'object' && typeof fleXenv.globalInit === 'function'){
fleXenv.globalInit();
}
if(this.style.getAttribute){
this.style.removeAttribute('filter');
}
});
});
(function(re){
$(document).click(function(e){
var t = e.target;
while (t.tagName && !re[0].test(t.tagName)){
t = t.parentNode || null;
}
if(t && t.tagName && !t.target || re[1].test(t.target)){
e.preventDefault();
$('#d1').animate({opacity: 0}, 600, 'linear', function(){
location = t.href;
});
}
});
})([/^(a|area)$/i, /^_(top|self|parent)$/]);
})(jQuery);