Advertisement

.

Saturday, April 9, 2011

Disable Drag and Drop


Disable Drag and Drop

You can disable drag and drop for both text and image by adding the following event handler to the element:

ondragstart='return false'


To disable drag and drop inside Blogger posts, follow these steps:
1. Go to Template > Edit HTML and click anywhere inside the editor.
2. Press Ctrl+F (Cmd+F in Mac), and a search box should appear on the upper right corner of the editor.
3. Use the search box to jump to this code:

<b:includable id='post' var='post'>

4. Next, click the arrow tip on the left of that line to expand the code. Once expanded, the second line should look something like this:

<div class='post hentry' itemprop='blogPost'itemscope='itemscope'itemtype='http://schema.org/BlogPosting'>

5. Insert the event handlers into the tag like this:



(onselectstart='return false' is added to disable text selection in IE9 and below.)

RELATED ARTICLES

0 comments:

Twitter Delicious Facebook Digg Stumbleupon Favorites More