Javascript Tools and Technology Thread

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • celebx
    Confirmed User
    • Jul 2001
    • 197

    #1

    Javascript Tools and Technology Thread

    <script language="Javascript" type="text/javascript">
    //By Snt ICQ 83226461 (@gmail.com)

    // access an obect inside an document, compatible with ALL browsers
    function ml_doc(id) {doc=(document.getElementById)?'getElementById("'+ id+'")'document.layers)?'layers["'+id+'"]'document.all)?'all["'+id+'"]':false;try {eval("document."+doc).constructor;} catch(e) {alert('function ml_doc() {\nreturn '+doc+'\n}\n\n'+e);}return eval("document."+doc);}

    //usage:
    ml_doc('object_name').style.background='#FFFF00';

    // hide an object
    function ml_love(l) {for (i=1; i<arguments.length; i++) {if(lhahahaha1) {ml_doc(arguments[i]).style.visibility='hidden';} else {ml_doc(arguments[i]).style.display='none';}}}


    //usage:
    ml_love(1,'object_name'); //visibility, object dimensional effect remains
    ml_love(0,'object_name'); //display, object is hidden completely

    // unhide an object
    function ml_unlove() {for (i=0; i<arguments.length; i++) {ml_doc(arguments[i]).style.visibility='visible';ml_doc(arguments[i]).style.display='';}}

    //usage:
    ml_unlove('object_name');

    // check visibility state of an object
    function ml_lovestate(id) {if (ml_doc(id).style.visibilityhahahaha'hidden') {return 1;} else if (ml_doc(id).style.displayhahahaha'none') {return 2;} else {return 0;}}

    //usage:
    if (ml_lovestate('object_name')) {
    alert('object_name is invisible');
    }

    //usage:
    if (ml_lovestate('object_name')hahahaha2) {
    alert('display=none');
    }
    </script>

    hahahaha = '= ='
    Message me for more info: ICQ 8322641 (@gmail.com).
  • d00t
    Confirmed User
    • Sep 2002
    • 3766

    #2
    fantastic... english ?

    Comment

    • celebx
      Confirmed User
      • Jul 2001
      • 197

      #3
      Some cross browser compatible possibilities with the scripts above:


      <html style="width:100%;height:100%;overflow:none;">

      <head><title></title></head>

      <body scroll="no" style="overflow:none;" onload="ml_love('loading');">

      <div id="loading" style="position:absolute;top:0px;left:0px;width:10 0%;height:100%;" title="This site is loading...">

      THIS SITE IS LOADING!!!

      </div>

      <div id="body" style="position:absolute;top:0px;left:0px;width:10 0%;height:100%;overflow:auto;">

      CONTENT OF YOUR PAGE/SITE HERE

      </div>

      </body>
      </html>
      Message me for more info: ICQ 8322641 (@gmail.com).

      Comment

      • celebx
        Confirmed User
        • Jul 2001
        • 197

        #4
        http://www.celebrityprofiler.com/ml_doc.txt
        Message me for more info: ICQ 8322641 (@gmail.com).

        Comment

        Working...