×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    User:Schäuble/monobook.js: Difference between revisions

    imported>mutante
    m (New page: /********************************** * Watching Script v1.1 * * by KnoedelDealer 2007/05/01 * * * * no copyright, free usage * *******...)
     
    imported>mutante
    m (User:mutante/monobook.js moved to User:Schäuble/monobook.js: seen him enough :p)
     
    (No difference)

    Latest revision as of 21:35, 28 May 2007

    /**********************************
     * Watching Script v1.1           *
     *  by KnoedelDealer   2007/05/01 *
     *                                *
     *  no copyright, free usage      *
     **********************************/
    
    
    var h = -150;
    var h2 = 1;
    var l = 100;
    var ie = (navigator.appName.indexOf('Internet Explorer') > -1) ? true : false;
    
    function watching() {
       var body = document.getElementsByTagName('body')[0];
       l = (body.offsetWidth - 140) * Math.random();
       var img = document.createElement('img');
       img.id = 'imgWatching';
       img.src = 'http://s23.org/w/images/1/1a/Schaueble-head.gif';
       img.title = 'i\'m watching you!';
       img.style.display = 'none';
       body.appendChild(img);
       if (ie) {
          img.style.position = 'absolute';
       } else {
          img.style.position = 'fixed';
       }
       img.style.bottom = h + 'px';
       img.style.left = l + 'px';
       h2 = Math.random() / 3;
       window.setTimeout('moveUp();', 1000);
    }
    
    function moveUp() {
       if (document.getElementById('imgWatching')) {
          var img = document.getElementById('imgWatching');
          if (img.style.display == 'none') {
             img.style.display = 'inline';
          }
          if (h < (0 - img.height * h2)) {
             h = h + 10;
             img.style.bottom = h + 'px';
             window.setTimeout('moveUp();', 50);
          } else {
             window.setTimeout('moveDown();', 1000);
          }
       }
    }
    
    function moveDown() {
       if (document.getElementById('imgWatching') && (document.getElementsByTagName('body').length > 0)) {
          var body = document.getElementsByTagName('body')[0];
          var img = document.getElementById('imgWatching');
          if (h > (0 - img.height)) {
             h = h - 10;
             img.style.bottom = h + 'px';
             window.setTimeout('moveDown();', 50);
          } else {
             img.style.display = 'none';
             l = (body.offsetWidth - 140) * Math.random();
             img.style.left = l + 'px';
             h2 = Math.random() / 3;
             window.setTimeout('moveUp();', 5000 * Math.random());
          }
       }
    }
    
    window.onload = watching;
    
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.