...

View Full Version : Multiple web backgrounds?



cartoongeorge96
01-21-2012, 02:54 PM
Hello,

What im basically trying to archive is, when i put an image on a web page you can drag the image to a new tab, and it will open. That's not really the problem, but more of an example. I need a way to stop you being able to drag the images, i think it just looks untidy.

I have a background image set, then a nav-bar, which is again an image and you can click and drag, i would like to prevent this.

Hopefully you know what i mean, this is of same problem i have. (http://stackoverflow.com/questions/4211909/disable-dragging-an-image-from-an-html-page)

Many thanks

George


Seems i found the solution, <div onmousedown="event.preventDefault ? event.preventDefault() : event.returnValue = false">

dylanbaumannn
02-03-2012, 06:38 PM
Also, another way to go about it would to simply change how you applied the background image to the div.

if you have it set as


<div>
<img src="image1.jpg" alt"" />
</div>


just change it to


div{
background-image:url(image1.jpg);
}


which should make it unavailable for dragging since it's being called up in the CSS, not in the HTML



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum