Saturday 4 June 2011

How to change your dhtml code to html code?

If it%26#039;s possible? I wanna convert this dhtml code to html.





%26lt;script language=%26quot;JavaScript%26quot;%26gt;





//Comment trail script- By Kurt (kurt.grigg@virgin.net)


//Script featured on Dynamic Drive


//Visit http://www.dynamicdrive.com for this script and more





colours=new Array(%26#039;#ff0000%26#039;,%26#039;#00ff00%26#039;,%26#039;#ffffff%26#039;,%26#039;#ff鈥?br>

n = 10;


y = 0;


x = 0;


n6=(document.getElementById%26amp;%26amp;!document鈥?br>

ns=(document.layers);


ie=(document.all);


d=(ns||ie)?%26#039;document.%26#039;:%26#039;document.getEl鈥?br>

a=(ns||n6)?%26#039;%26#039;:%26#039;all.%26#039;;


n6r=(n6)?%26#039;%26quot;)%26#039;:%26#039;%26#039;;


s=(ns)?%26#039;%26#039;:%26#039;.style%26#039;;


if (ns){


for (i = 0; i %26lt; n; i++)


document.write(%26#039;%26lt;layer name=%26quot;dots%26#039;+i+%26#039;%26quot; top=0 left=0 width=%26#039;+i/2+%26#039; height=%26#039;+i/2+%26#039; bgcolor=#ff0000%26gt;%26lt;/layer%26gt;%26#039;);


}


if (ie)


document.write(%26#039;%26lt;div id=%26quot;con%26quot; style=%26quot;position:absolute;top:0px;left:0p鈥?style=%26quot;position:relative%26quot;%26gt;%26#039;);


if (ie||n6){


for (i = 0; i %26lt; n; i++)


document.write(%26#039;%26lt;div id=%26quot;dots%26#039;+i+%26#039;%26quot; style=%26quot;position:absolute;top:0px;left:0p鈥?br>

}


if (ie)


document.write(%26#039;%26lt;/div%26gt;%26lt;/div%26gt;%26#039;);


(ns||n6)?window.captureEvents(Event.MO鈥?br>

function Mouse(evnt){


y = (ns||n6)?evnt.pageY+4 - window.pageYOffset:event.y+4;


x = (ns||n6)?evnt.pageX+1:event.x+1;


}


(ns)?window.onMouseMove=Mouse:document鈥?br>

function animate(){


o=(ns||n6)?window.pageYOffset:0;


if (ie)con.style.top=document.body.scrollTo鈥?br>

for (i = 0; i %26lt; n; i++){


var temp1 = eval(d+a+%26quot;dots%26quot;+i+n6r+s);





randcolours = colours[Math.floor(Math.random()*colours鈥?br>

(ns)?temp1.bgColor = randcolours:temp1.background = randcolours;


if (i %26lt; n-1){


var temp2 = eval(d+a+%26quot;dots%26quot;+(i+1)+n6r+s);


temp1.top = parseInt(temp2.top);


temp1.left = parseInt(temp2.left);


}


else{


temp1.top = y+o;


temp1.left = x;


}


}


setTimeout(%26quot;animate()%26quot;,10);


}


animate();


// --%26gt;


%26lt;/script%26gt;|||Dynamic HTML, or DHTML, is an umbrella term for a collection of technologies used together to create interactive and animated web sites by using a combination of a static markup language (such as HTML), a client-side scripting language (such as JavaScript), a presentation definition language (such as CSS), and the Document Object Model.





DHTML allows scripting languages to change variables in a web page%26#039;s definition language, which in turn affects the look and function of otherwise %26quot;static%26quot; HTML page content, after the page has been fully loaded and during the viewing process. Thus the dynamic characteristic of DHTML is the way it functions while a page is viewed, not in its ability to generate a unique page with each page load.





Strip the Javascript from top to bottom. Removing the JS means the Mouse Trails script will not work.





Ron