Wednesday, May 30, 2012

Using Javascript To Disable Text Selection On Blog/Website/Blogger?



Using Javascript To Disable Text Selection On Blog/Website/Blogger?

You may need to disable text selection of an HTML page it is very simple.how you can do it below is the java source code with this code you do not have to mess with Template HTML code.



Step:
Go TO Layout.
Select Add A Widget.
Add a HTML/Javascript widget to tour blog.
Paste the code inside it and click on save.

Click Here To Copy the code.

<script type="text/javascript" language="JavaScript">
function disableText(e){
return false
}
function reEnable(){
return true
}
//For browser IE4+
document.onselectstart = new Function ("return false")






//For browser NS6
if (window.sidebar){
document.onmousedown = disableText
document.onclick = reEnable
}
</script>


Work Is Done.Test your blog.

0 comments:

Post a Comment

Make sure to click the "Subscribe By Email" link below the comment for to be notified of follow up comments and replies..