Disable text/image selection in Facebook App

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
peterjwest
Forum Commoner
Posts: 63
Joined: Tue Aug 04, 2009 1:06 pm

Disable text/image selection in Facebook App

Post by peterjwest »

I'm making a drag and drop script and I'm trying to disable text/image selection because when the user drags the item it selects text and images underneath. However facebook's JS sandbox doesn't support this format:

Code: Select all

document.onselectstart = function() {return false} // ie
document.onmousedown = function() {return false} // mozilla
it only supports:

Code: Select all

document.addEventListener('onselectstart ', function() {return false})
which doesn't seem to work.
Does anyone know a workaround for this?
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Disable text/image selection in Facebook App

Post by kaszu »

Instead of "onselectstart " first arguments should be "selectstart" without "on".
Post Reply