SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot nikola8's Avatar
    Join Date
    Jun 2006
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    static page ajax style preloader

    I have simple static page with many images and would like to make that fancy ajax style preloader - some gif with "loading...".
    Just to have one transparent div and that image before all images and page would be 100% loaded.

    Please help me.

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If i have understood, just have a div in a spcific location from the absolute top and left. And you can put one loading (i mean moving image) inside the div and make the div visibility false in default. And you have 4 different readyStates 1-4 in ajax, until the ajax readyState goes to 4, just make the loading div visible and make it again hidden whenever the readyState reaches 4.
    Code:
    	if(xmlHttp.readyState == 1){
    		divLoading.style.visibility = 'visible';
    	}
    	if(xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){
    		divLoading.style.visibility = 'hidden';
    		divObj.innerHTML = xmlHttp.responseText
    	}
    Does this make any sense of your problem?
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the ajax preloader image gif, try out http://ajaxload.info/, you can create the web 2.0 style images

  4. #4
    SitePoint Zealot nikola8's Avatar
    Join Date
    Jun 2006
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rajug View Post
    If i have understood, just have a div in a spcific location from the absolute top and left. And you can put one loading (i mean moving image) inside the div and make the div visibility false in default. And you have 4 different readyStates 1-4 in ajax, until the ajax readyState goes to 4, just make the loading div visible and make it again hidden whenever the readyState reaches 4.
    Code:
    	if(xmlHttp.readyState == 1){
    		divLoading.style.visibility = 'visible';
    	}
    	if(xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){
    		divLoading.style.visibility = 'hidden';
    		divObj.innerHTML = xmlHttp.responseText
    	}
    Does this make any sense of your problem?
    Thanks.
    I have to try. Is there some more code? What to include?


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
  •