|
| |
|
|
dumass
Posts: 62 From: London Status: offline
|
making a popup from a small image - 6/22/2005 17:12:02
Hi all. I haven’t visited in a while but would love some help from anyone with specific knowledge about making a popup from a small image? I have tried various javascripts including one specifically aimed at frontpage 2000 users but without success. What tends to happen is that once I’ve tried to add the script, a text link appears above the image i want to be the link. Clicking this link does open a new window, which says something along the lines of ‘cannot find server’. Assuming my image is called 001small.jpg and the page which I want in a popup is called poptest.htm, can anyone explain or point to where I might be going wrong? Cheers to anyone who can point me in the right direction. Ps. Also do I need to upload the site to see if the popup works correctly?
|
|
|
|
Kitka
Posts: 2512 Joined: 1/31/2002 From: Australia Status: offline
|
RE: making a popup from a small image - 6/22/2005 17:53:57
Hi dumass, Try this: <a onClick="var popup =window.open('poptest.htm','Popup Test','toolbar=no,menubar=no,width=400, height=400, resizable=yes,menubar=no,status=no,scrollbars=yes');popup.focus(); return false" href="poptest.htm"><img src="0001small.jpg"></a>
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: making a popup from a small image - 6/23/2005 15:22:21
quote:
<A HREF="javascript:popup()"><img src="001sml.jpg"></A> you are getting 2 images because....javascript:popup() calls the function popup which opens a window.... this part "()"><img src="001sml.jpg">" displays an in image
_____________________________
Dan
|
|
|
|
dumass
Posts: 62 From: London Status: offline
|
RE: making a popup from a small image - 6/23/2005 16:50:35
thanks for the reply but i'm not understanding it properly. Instead of clicking on my small image and getting a larger version in a popup, i'm getting an identical small image on top of my original (see above picture) one of which is clickable and opens a popup, though no larger image is inside. Using Kitka's script above as an example can you tell me might be going wrong? Cheers again ps. does it go in the head or body section? Some i've come across go in both!!
|
|
|
|
Kitka
Posts: 2512 Joined: 1/31/2002 From: Australia Status: offline
|
RE: making a popup from a small image - 6/23/2005 17:25:54
quote:
does it go in the head or body section? My example goes in the body section. If you could give us a URL to see your code in action, it would be much quicker and easier to help.
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
dumass
Posts: 62 From: London Status: offline
|
RE: making a popup from a small image - 6/23/2005 19:53:14
http://www.imagesofbritain.com/squares/squind3.htm Hi kitka. I've used this page as a trial for your script. The image on the top row, far right called 'pn001small' is the example in this instance i would like to popup when clicked.The page for which the popup should retrieve the info is called 'devilsarrows.htm'. The script is added to the very end of the body tag (if you can find it) on the main small images page as in the link above. I made some changes as necessary to suit the image and new page. Also i'm getting absolutley NOTHING happen after installing. No duplicate and no popup at all! thanks again
|
|
|
|
dumass
Posts: 62 From: London Status: offline
|
RE: making a popup from a small image - 6/23/2005 19:59:28
i wa wrong when mentioning nothing has happened. i've just seen the duplicate pn001.jpg at the bottom of the page from the above link which when clicked on takes me to the devilsarrows page but doesn't produce a popup.
|
|
|
|
Kitka
Posts: 2512 Joined: 1/31/2002 From: Australia Status: offline
|
RE: making a popup from a small image - 6/23/2005 20:41:04
quote:
doesn't produce a popup It does for me in Firefox but not IE. I think the problem is your use of a space in this bit: 'Popup devilsarrows' I find that either closing the space, or substituting an underscore allows it to work properly in IE: eg 'Popup_devilsarrows'
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: making a popup from a small image - 6/24/2005 9:08:05
popup =window.open eliminate the space after popup...popup= and not popup =
_____________________________
Dan
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: making a popup from a small image - 6/24/2005 16:53:13
<script>
function openpopup(){
var popurl="http://www.imagesofbritain.com/squares/greenaura.htm"
winpops=window.open(popurl,"","width=550,height=450,scrollbars,")
}
</script>
<!-- End -->
<a href="javascript:openpopup()"><img src="020smll.jpg" width="133" height="137"></a>
<!-- ImageReady Slices (squaresnoimage.psd) -->
<table WIDTH="780" BORDER="0" CELLPADDING="0" CELLSPACING="0">the isolated image at the top is because you have this code (from above) wherein you are placing the image before the table: <a href="javascript:openpopup()"><img src="020smll.jpg" width="133" height="137"></a> eliminate that and you should be fine <smile>
_____________________________
Dan
|
|
|
|
Kitka
Posts: 2512 Joined: 1/31/2002 From: Australia Status: offline
|
RE: making a popup from a small image - 6/24/2005 19:45:21
quote:
Incidentally it's that isolated image that produces the popup when clicked on and not the one i want which is the first one on the top row Hi Mike, You need to apply the javascript to the image in your table cell rather than adding it at the beginning or end of your table. Right now you have this code for the cell containing the image you want to produce a popup when it is clicked: <td WIDTH="150" HEIGHT="150" bgcolor="#C0C0C0">
<p align="center"><a href="greenaura.htm"><img border="0" src="020smll.jpg" width="133" height="137"></a></p></td> Change that to this code: <td WIDTH="150" HEIGHT="150" bgcolor="#C0C0C0">
<p align="center"><a href="javascript:openpopup()"><img src="020smll.jpg" width="133" height="137" border="0"></a> </p>
</td> The big difficulty that I see with you using this script, is if you are planning to have popups for all the images on that page. That script will always open the same destination page. If you wish to have the script open different destination pages, the one I gave you is much more suitable, because it goes in the body, and you can tailor the code for each popup to suit. <Off topic>It really isn't a good idea to use heights for tables or table cells. It can cause problems in other browsers and different resolutions. It is far better to allow the browser to set its own height.
_____________________________
Kitka **It is impossible to make anything foolproof because fools are so ingenious.**
|
|
|
|
dpf
Posts: 7121 Joined: 11/12/2003 From: India-napolis Status: offline
|
RE: making a popup from a small image - 6/25/2005 8:19:51
mike (sounds better than dumass) - kitka is correct - a function placed in the head is then available to be "called" from anywhere in the body so the <img I mentioned need only be placed where you want it in the body to "call" the function - make sense. she is also correct in that the way that function is presently written, it will always go to the same url - there is a way to avoid that by passing the new url as a parameter but, unfortunately, its 730 am on hangover saturday and I am not up to the task... try kitkas alternative.
_____________________________
Dan
|
|
|
|
dumass
Posts: 62 From: London Status: offline
|
RE: making a popup from a small image - 6/25/2005 9:07:40
progress at last!! Before switching on the comp it dawned on me to add that part of the script to the image itself and it did the trick - almost. There is now a border around the image and a stray character to the bottom right. At least there's no duplicate image and the popup works - in my browser at least. Kitka, you're right in that i do want to add popups to all the images and i can see how the script is no good for that. I'll have a look at your original script and give it another go but be warned i may well be back seeking help or singing praises - hopefully the latter. re my site. The main look was done in adobe which was set at 780pxls. If i'd worked in fp only i would have used table at 100%. Presume it looks pretty bad in non explorer browsers!Once again thanks guys for all the help. Mucho appreciated
|
|
|
|
dumass
Posts: 62 From: London Status: offline
|
RE: making a popup from a small image - 6/25/2005 11:30:31
back again (before you've even had a chance to reply)!Kitka, i've tried your original script substituting the relevant bits and placed it where the small image is within the table in the html section. I then uploaded the site. On clicking i'm taking to the right page - like a normal link but there is no popup. Below is your script which is currently used:- <a onClick="var popup=window.open('http://www.imagesofbritain.com/squares/greenaura.htm','Popup greenaura','toolbar=no,menubar=no,width=590, height=480, resizable=yes,menubar=no,status=no,scrollbars=yes');popup.focus(); return false" href="http://www.imagesofbritain.com/squares/greenaura.htm"><img src="020smll.jpg"></a> Am i placing it in the wrong place or is the script not quite right? I know its easy to mess up and wouldn't know what to look for so if you can check it out for any obvious mistakes or suggest anything to get that lovely popup working it'd be great
|
|
|
|
dumass
Posts: 62 From: London Status: offline
|
RE: making a popup from a small image - 6/27/2005 18:58:03
I've been trying to reply for the last few days but sometimes when i go online the majority of web pages look like something from the dos days and it means i can't reply to posts nor send emails from my yahoo account (no idea what happens or why). Fortunately things are back to normal so i can respond finally. I'm glad to say everything is fine now. I tried a few scripts while away from this board and one worked fine - thanks to your patient help. I've still got yours kitka as a back up should i need it! So a final Thanks to all - mike
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|