Sup guys,
i build a website with draging of window like divs, but when somebody drags a div it sometimes selects some images.
so im looking for a way to disable selecting images all over the website, i know its posible but i dont know how.
Printable View
Sup guys,
i build a website with draging of window like divs, but when somebody drags a div it sometimes selects some images.
so im looking for a way to disable selecting images all over the website, i know its posible but i dont know how.
Hi Nathan,
Are you using the jQuery UI to perform the draggable instances? If so there is a disableSelection() function that may be of use.
Aside from that, I'm afraid i'm not sure.
Good luck !
no im not using jquery ui, does any one else have an idea
i have found something but i dont know how to enable it on all images:
http://wiki.forum.nokia.com/index.ph...n_in_web_pages
You might try this--its an adaptation of the code you linked to.
Code:window.onload = init;
function init() {
var i, x = document.getElementsByTagName('img');
for ( i = 0; i < x.length; i++){
disableDraggingFor(x[i]);
}
}
function disableDraggingFor(element) {
// this works for FireFox and WebKit in future according to http://help.dottoro.com/lhqsqbtn.php
element.draggable = false;
// this works for older web layout engines
element.onmousedown = function(event) {
event.preventDefault();
return false;
};
}