Log in

View Full Version : Need a script that upon mouseover on the original image, an identical image pops up..



norbyson
10-12-2008, 11:03 PM
First off, I am a newbie to coding and a newbie to this forum as you can see:).

I am developing my first major website using Dreamweaver CS3. I love this application! There are going to be a great deal of images on my pages. I would like to setup most of my images so that when someone hovers over them a bigger image pops up, like this:
http://www.dynamicdrive.com/style/csslibrary/item/css-popup-image-viewer/
(hover over those thumbnails to see what I am talking about). I understand that the scripts are there, but have tried to embed it (the CSS one) into my code on DWCS3 and can't seem to get it to work. So, I would appreciate it if you can either explain how to make that script work, give me a simpler script that gets the job done, or a completely different option that will display my images well and is simpler to accomplish.

On a different note, does anyone know how to protect images from being copied by other users? Is there a particular code that I can embed in the code of my images so when someone tries to copy them they are denied or unable to do so? Suggestions with this would also be appreciated.

Thanks.:D

fobos
10-13-2008, 03:55 AM
norbyson,
ok well this wasnt really hard to figure out. i too use DWCS3, so i will show you how to link your .css to your page?
To link your .css, try this:
<link rel="stylesheet" type="text/css" href="link to .css" />

for the "do not copy my pics" script:
create a .js script and call it something like "_noclick.js" or whatever you want.

<script type="text/javascript">
var message="";
function clickIE() { if (document.all) {(message);return false;}}
function clickNS(e) { if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message); return false;}}}
if (document.layers) { document.capturEvents(Event.MOUSEDOWN); document.onmousedown=clickNS;}
else { document.onmouseup=clickNS; document.oncontextmenu=clickIE;}
</script>
or just load it externaly (which is better for load time on the web page)
<script type="text/javascript" src="location of js script"></script>

there you go let me know it you have anymore problems

norbyson
10-13-2008, 05:17 AM
norbyson,
ok well this wasnt really hard to figure out. i too use DWCS3, so i will show you how to link your .css to your page?
To link your .css, try this:
<link rel="stylesheet" type="text/css" href="link to .css" />

for the "do not copy my pics" script:
create a .js script and call it something like "_noclick.js" or whatever you want.

<script type="text/javascript">
var message="";
function clickIE() { if (document.all) {(message);return false;}}
function clickNS(e) { if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message); return false;}}}
if (document.layers) { document.capturEvents(Event.MOUSEDOWN); document.onmousedown=clickNS;}
else { document.onmouseup=clickNS; document.oncontextmenu=clickIE;}
</script>
or just load it externaly (which is better for load time on the web page)
<script type="text/javascript" src="location of js script"></script>

there you go let me know it you have anymore problems

Thanks Fobos for the script - I will give it a go!

What is your take on the image pop-up on mouse-over I had mentioned too?