How can I....

He has: 12 posts

Joined: Dec 2003

I think it is possible, but can I make it so when someone clicks my link, and the link is to a pic, I want to make it so when the pic shows up, it is not a whole page, it is a small box that surrounds the pic. Is that possible without Javascript?

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

If you are refering to having the window be just the size of the picture, then this will require javascript.

If you are talking about drawing a box around it yourself, then yes this can be done jsut by making a web page like that.

And if you are talking about when they click on a link directly to the image (i.e. ) there is also a way of doing this. Here is something similar I did once:

For an art site, all the actual artwork was placed into one directory. In that directory I added soemthing like the following to the .htaccess file:

Action application/x-greg-protimg <em>[b]Path to my program[b]</em>
AddType application/x-greg-protimg .jpg
'

With this, anytime a file of type .jpg is called, the server actually calls my script. The script then checks to see what was calling the file, and if was from the site I made, it would display it, otherwise it would give a message saying access denied.

So something similar to this could be used, and when they call an image, actually feed them out a web page with the box around the image. (note however, that this would cause a problem if you then tried to display the image IN a web page)

-Greg

He has: 12 posts

Joined: Dec 2003

Ok, I want the first one, I know about making a box around an image, I could do that with the border tag. Umm, what javascript would it be to get the window to be the same size as the pic?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Yes, it's possible without JavaScript. I know a few people did some tricky swapping with CSS. I don't have the details though.

He has: 12 posts

Joined: Dec 2003

If u do come across that coding, can u post it here, even if u come upon the javascript, could u post it here, I appreciate all the help you guyz give.

AYYASH's picture

He has: 10 posts

Joined: Jan 2004

Here is the code you are looking for (no need for java script):

This code works with graphics not text. I'll try to look for another code that works with text either.

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

the onClick part *is* calling javascript. Plus he'll need the javascript that has the function "MM_openBrWindow()" in it. (looks like one of Macromedia's canned functions). Lastly, just to clarify if you want to use it, the main part that does the opening is the onClick portion, the use of an image map is not needed. (put the onClick part in a normal type tag.

-Greg

AYYASH's picture

He has: 10 posts

Joined: Jan 2004

Thanks Greg. I was wrong. He also needs to put this in the to make the link works:

<script language=JavaScript>

</script>

He has: 12 posts

Joined: Dec 2003

So the stuff right abouve my post, I will need to put that all in the head tag? Btw, thnx so much for this

mjs416's picture

They have: 127 posts

Joined: Dec 2003

JEFF_HARDY wrote: So the stuff right abouve my post, I will need to put that all in the head tag? Btw, thnx so much for this

I'll send you an example when I get a second, Spidey. There are many variables you can set with the window that pops open. Visible address bar? Re-sizeable? There is a certain syntax to it too.

PM me with your email.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

zerocattle.com/examples/popUp.html

You can either set the width and height to the same size as the image (works in some browsers, but not most, or you can make an .html for each image that puts the image on a page without borders.

You can also write the JavaScript in a way to generate the page itself, as someone has done on these forums, you might want to search for it.

AYYASH's picture

He has: 10 posts

Joined: Jan 2004

Thanks to Suzanne for the popup link. It's really useful.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You're welcome. It should work for XHTML 1.0 strict as well as down to HTML 4.01 Transitional. Use it in good health. Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.