af83

Totally useless 'ajax' 'loading' image in the address bar as a spinning thing

Welcome to probably the most useless blog post on the web.

Now you can happily animate stuff in the address bar (do you remember the nineties and nice status bar animations ? :) ) .

The beautiful online demo can be found here : Demo of animated address bar

<html>
<head>
<title>Totally usesless 'ajax' 'loading' image in the address bar as a spinning thing</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="AF83.com" />
<script language="JavaScript">
<!--
/**
 *  Copyright (c) 2007, AF83
 *  All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without modification,
 *  are permitted provided that the following conditions are met:
 *
 *  1° Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *
 *  2° Redistributions in binary form must reproduce the above copyright notice,
 *  this list of conditions and the following disclaimer in the documentation
 *  and/or other materials provided with the distribution.
 *
 *  3° Neither the name of AF83 nor the names of its contributors may be used
 *  to endorse or promote products derived from this software without specific
 *  prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COMPANY AF83 AND CONTRIBUTORS "AS IS"
 *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 *  OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *  @copyright  2007 AF83 Ori Pekelman
 *  @license    BSD License (3 Clause) http://www.opensource.org/licenses/bsd-license.php
 *  @package    Useless Stuff
*/
// Configure :
var TextBefore=' ...  Loading ... ';
// End configuration
var AddressBarLoaderTimeOut;
var OriginalLocationHash = document.location.hash; // so we can restore original url

function loc_hash(a){
 document.location.hash =TextBefore+a;
}

function spinStart(){
    AddressBarLoaderTimeOut=setTimeout("spinStart()",100);
    loc_hash("|");
    loc_hash("/");
    loc_hash("-");
    loc_hash("");
    loc_hash("|");
    loc_hash("/");
    loc_hash("-");
 }
 function spinStop(){
     document.location.hash=OriginalLocationHash;
     clearTimeout(AddressBarLoaderTimeOut) ;
     }
// -->
</script>
</head>
<body >
<h1>Totally usesless 'ajax' 'loading' image in the address bar as a spinning thing</h1>
<div style="margin:100px;height:100px;width:100px; background-color:#333;font-size:18;color:white;" onclick="spinStart();">Click on me to start address bar ajax loader</div>
<div style="margin:100px;height:100px;width:100px; background-color:#333;font-size:18;color:white;" onclick="spinStop();">Click on me to stop</div>
</body>
</html>

blog comments powered by Disqus