View Single Post
Old 01-20-2005, 06:02 AM  
celebx
Confirmed User
 
Join Date: Jul 2001
Location: The Netherlands
Posts: 197
ml_doc()

<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(0,'object_name'); //visibility, object dimensional effect remains
// ml_love(1,'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');


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();
//}

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

</script>
__________________
Message me for more info: ICQ 8322641 (@gmail.com).
celebx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote