Saturday, 23 June 2012

Javascript Disable Select

function disableselect(e)
{
return false;
}
function reEnable()
{
return true
}
function enable_select()
{
document.onselectstart=new Function ("return true")
document.oncontextmenu=new Function ("return true")
//if NS6
if (window.sidebar)
{
document.onmousedown="";
document.onclick="";
}
}
function disable_select()
{
//if IE4+
document.onselectstart=new Function ("return false")
document.oncontextmenu=new Function ("return false")
//if NS6
if (window.sidebar)
{
document.onmousedown=disableselect
document.onclick=reEnable
}
}

this is second label

No comments:

Post a Comment