Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Web-Site Drag Image

Author
Message
Dimension
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 27th Feb 2010 11:57
I'm creating a web-site with dreamweaver and am working on my navigation bar and am trying to find a way to make to where if the user clicks on a button and drags it, it won't try to select the image. Is there a way to disable the drag ability.

Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Feb 2010 02:42 Edited at: 28th Feb 2010 02:43
You can't really disable it, it's a system/browser thing. You can cheat a little bit by putting an empty layer over top of the image so the user can't select the image. Myspace sort of does this with its photo tagging.

Not really sure why you're concerned with disabling this anyway, if the user wants the image he can still grab it through the source pretty easily.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
ShaunRW
DBPro Developer
17
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 28th Feb 2010 15:17
Quote: "Not really sure why you're concerned with disabling this anyway, if the user wants the image he can still grab it through the source pretty easily"


But it makes it look crummy when the user highlights it by accident. And Stops noobs grabbing the image if they don't know how to view the source. Up until a few years ago, i didn't know you could view the source. Even then they have to understand a bit of html to get the image they want.

The only way i can think of is what Phaelax said.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 28th Feb 2010 19:21
I think there's definitely another way to achieve it than an empty layer - I've noticed that Facebook does this recently.

If you comment but it does not do so immediately (text stays in the box and it wait a while) it prevents you from highlighting or selecting any bit of the page at all, without making anything go read only. I'm confused as to why it does it, but it certainly does do it.

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Feb 2010 23:34
If you are talking about Firefox's 'feature' where it will let you drag images, then you can turn that off on individual images by using a little js;



I believe you could probably also use jquery to target every image on the page.

Boo!
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 28th Feb 2010 23:53
I don't understand... I can't drag images...

Windows Vista 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
BearCDP
15
Years of Service
User Offline
Joined: 7th Sep 2009
Location: NYC
Posted: 1st Mar 2010 03:25
I can


...
......


Dear lord, both the choose file and post message button say "Choose File" and the search button under Thread Subject Search says "Post Message


JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 1st Mar 2010 05:44
there's easier ways to grab images off sites than looking at the source. I think using anything to block that is stupid and just frustrates users. If they want the image, they'll get it and you've successfully lost a customer/user. If they don't want the image, you've successfully lost a customer/user. I mean, the average idiot can download a plugin or something.

Your mother has been erased by a mod because it's larger than 600x120
BiggAdd
Retired Moderator
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: != null
Posted: 1st Mar 2010 06:30
You could always use CSS to style your buttons. Instead of using image files directly in the HTML, you can always change the backgrounds of the links with CSS.

The user can't drag a CSS background.

Dimension
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 1st Mar 2010 16:39 Edited at: 1st Mar 2010 17:01
I'm making it to where the user can't drag the button to create a better look and feel on the web-site(draging it causes the button to turn blue and could be anoying to someone). [onmousedown="if (event.preventDefault) event.preventDefault()"] seems to work very good for doing this. I think this solution will come to very good use for the rest of my web-site as well.
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 1st Mar 2010 17:00
Quote: "Dear lord, both the choose file and post message button say "Choose File" and the search button under Thread Subject Search says "Post Message"


That's a daily occurrence for me... :/

Windows Vista 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
BearCDP
15
Years of Service
User Offline
Joined: 7th Sep 2009
Location: NYC
Posted: 3rd Mar 2010 11:40
Are you on Chrome or Firefox? I can't remember which I was in when I posted
Curse the unavailability of stable and useful browsers on OS X.


Dimension, do you have a link comparing the two? I still don't quite understand what you've managed to overcome.

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 3rd Mar 2010 15:54
Chrome

Windows Vista 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Mar 2010 07:32
Chrome is only available if you have intel processors, no version for us PPC users.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke

Login to post a reply

Server time is: 2025-05-24 22:16:40
Your offset time is: 2025-05-24 22:16:40