Code: Select all
$('A').each(function() {
$(this)
.css('MozUserSelect','none')
.bind('selectstart', function() {
return false;
})
.bind('draggesture', function() {
return false;
});
});Moderator: General Moderators
Code: Select all
$('A').each(function() {
$(this)
.css('MozUserSelect','none')
.bind('selectstart', function() {
return false;
})
.bind('draggesture', function() {
return false;
});
});It's useful because it happens to me a lot in FF. Sometimes when I'm clicking something, I end up clicking and dragging by accident. It happens either with a stuck mouse, or a stuck touchpad, etc. What happens is that FF creates a "ghost-like" copy of the text I just clicked, makes it swing out wherever the cursor is, and then when I lift the mouse up, it swings back where it was. It's distracting and ugly. This is part of the browser's normal drag and drop features. I noticed in Gmail that they turned this off on some of the links. So, I set out to figure this out. With enough experimentation, I figured it out.kaszu wrote:Thanks for sharing.
Only I can't imagine when it would be useful.
Gmail doesn't actually use this on links, just things which look like links (ie have a 'hand' cursor when you're hovering over them, but aren't 'a' tags).supermike wrote: I noticed in Gmail that they turned this off on some of the links. So, I set out to figure this out. With enough experimentation, I figured it out.