Results 1 to 3 of 3

Thread: J Scheuer Fade-in Fade-out Same Div on Different Pages

  1. #1
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    228
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default J Scheuer Fade-in Fade-out Same Div on Different Pages

    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 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.
    Code:
    (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);
    Last edited by KennyP; 01-06-2015 at 11:04 AM.

  2. #2
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    If it helps, it works fine here in Opera and Chrome but fails in Firefox.

  3. The Following User Says Thank You to styxlawyer For This Useful Post:

    KennyP (01-03-2015)

  4. #3
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    228
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default

    Thanks for your feedback. I just edited my post for accuracy.
    It's also in Firefox where I discovered the div content is no longer there when returning to its page with the back button.
    Previously that never happened with John's code. It worked in FF as well as you see in Opera and Chrome.

    Happy New Year
    Last edited by KennyP; 01-03-2015 at 11:07 AM.

Similar Threads

  1. Replies: 3
    Last Post: 07-12-2010, 04:04 PM
  2. Replies: 3
    Last Post: 04-26-2010, 04:51 PM
  3. Ultimate fade-in slideshow - fade-in time change
    By TheJoe in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-06-2009, 04:51 PM
  4. Ultimate Fade in Slideshow - how to require FIRST image to fade in?
    By charmedworks in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 06-17-2008, 07:12 PM
  5. Change fade time in Ultimate Fade In slideshow
    By Zaphodz in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 11-17-2006, 01:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •