Wednesday, August 20, 2014

How to Disable Text Selection in Blogger













1. Go to your blogger Dashboard and click on Layout.

2. Then click on Add Gadget.

3. Choose Html/Javascript From Popup Window

4. Now Copy and Paste below code into it.

<script type="text/javascript">

var dsblselect=["input", "textarea", "select"]

dsblselect=dsblselect.join("|")

function disableselect(e){

if (dsblselect.indexOf(e.target.tagName.toLowerCase())==-1)

return false }

function reEnable(){

return true }

if (typeof document.onselectstart!="undefined")

document.onselectstart=new Function ("return false")

else {

document.onmousedown=disableselect

document.onmouseup=reEnable }

</script>

5. Now save it and you are done disabling right click on your blog.

0 comments:

Post a Comment