SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post jQuery: Why does the transition blink.

    Whispering Turbines, Inc.

    This is the website that is in question. Below is the script that I think is causing the problem. Every time you navigate to a new page I want the pages to fade out/in. However, there is a brief blink in between animations. I have tried to use stop() and not, but neither seems to help. I will post both options.

    Option 1:
    Code JavaScript:
    $(document).ready(function() {
    	$('body').css('background-color', '#000');
    	$('body').css('display', 'none');
        $('body').fadeIn(1000);
    	$('a').click(function(event){
            event.preventDefault();
            linkLocation = this.href;
            window.location = linkLocation;
            });
    });

    Option 2:
    Code JavaScript:
    $(document).ready(function() {
    	$('body').stop().css('background-color', '#000');
    	$('body').css('display', 'none');
        $('body').fadeIn(1000);
    	$('a').click(function(event){
            event.preventDefault();
            linkLocation = this.href;
            window.location = linkLocation;
            });
    });
    Last edited by paul_wilkins; May 29, 2011 at 00:05.


Tags for this Thread

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
  •