Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Colored buttons

Add some color to the buttons of our forms.


<script language=JavaScript>
//Insert these lines into any place of page
//Set parameter "ID" for buttons so that it began with "butt".
//For example - "button1", "button2", "butt_shan"...
//You can use all types of buttons - "button", "submit", "reset".
//It is possible to add to them events. E.g. - onClick.
//---- Choice of variables ----\\
m_over_col="#ff9944"
m_out_col="#c0c0c0" // - standard color
m_down_col="#ee5555"
//---------The description---------\\
/*
m_over_col - Color of buttons at MouseOver
m_out_col - Color of buttons at MouseOut and initial colors
m_down_col - Color of buttons at MouseDown
*/
//----------------------------------\\
dow_key=''
window.onload=recolor_butt
function recolor_butt()
{
len_all=document.all.length
for (i=0; i<len_all; i++)
{
id=document.all[i].id
if (id.indexOf('butt')==0)
{
document.all[i].style.background=m_out_col
}
}
}
function document.onmouseover()
{
id=window.event.srcElement.id
if (id.indexOf('butt')==0)
{
if(dow_key==id){return}
document.all[id].style.background=m_over_col
}
}
function document.onmouseout()
{
id=window.event.srcElement.id
if (id.indexOf('butt')==0)
{
if(dow_key==id){return}
document.all[id].style.background=m_out_col
}
}
function document.onmousedown()
{
id=window.event.srcElement.id
if (id.indexOf('butt')==0)
{
if(dow_key!=''){document.all[dow_key].style.background=m_out_col}
dow_key=id
document.all[id].style.background=m_down_col
}
}
</script>


Download code...


Print this page


 

Inizio pagina

risorse per webmaster

javascript


html javascript checked onclick rollover document javascripts foreach innerhtml frameset document write css getelementsbytagname javascript menus selected scrollbar onmouseover textarea substring example javascript iframe uppercase textbox javascript class onload indexof referrer dhtml navigation javascript javascript tree menu script close frame onclick script language javascript innerhtml text javascript onchange script html tutorial javascript onmouseover onblur frameset document write getelementbyid eval dhtml javascript script script popup script dhtml scripts javascript script scroller html script javascript java script javascript javascript include script script checkbox script in javascript script javascript script language javascript src script language javascript type

asp, scripts, tutorials,




Webmaster resources Morpheusweb.it - Webmaster resources
asp, dhtml

Morpheusweb.it - Webmaster resources" asp, javascript, php, tutorials, manuals, scripts