Photography Websites

I find that while trying to make my site better and learn all that I can that there are very few places to find help with my type of site.<br />
<br />
Although it would be great to be listed with all of the major search engines it is more important that I'm known locally as that is were most of my business is going to come from. I do try to optomize for the search engines and am listed on some of the major ones. The biggest rule that I have to break would be the one about keeping graphics small. When I test for load times I've gotten used to seeing a poor or worse rating but I can live with that. I'll get to my point shortly.<br />
<br />
I live in a rural area and have to write for 28K modems using a dial up connection for the most part. I have a cable hook up but most don't. Internet Explorer is used by most to view my site. What I try to do is keep my homepage fast and try to draw them to the thumbnalls and everything is acceptable to that point. What I would really like would be a piece of code that would open the thumbs in a separate window the size of the imagae. I would imagine that it would have to be javascript (something I know little about) I'd exparimented once and found one that would work in IE but not netscape. Is there something that would work equally well in both browsers? It would be great if there as one that worked in all. Also, would I have to place the code for each occurance of a thumbnail? In hope if finding such code one day I have sized all of my images the same. The only difference would be a horizontal or verticle view and I could just flip flop the height and width figures. Thanks in advance for any help......Steve<!--content-->Steve, what you are asking is pretty basic. I am moving your post to the html layout section, but it could easily have been in the cross browser or even client side scripting section too (javascript).<br />
<br />
Your chances of getting good replies are better in any of above 3 forums than in the aquiring skills forum (I think)<br />
<br />
I am sure someone will answer your question, because it is really not hard..<br />
<br />
If I understand you correctly, then you want the thumbnail images to appear in the main window, but when they are pressed then the new (larger) images must open in the new window, and they must all be the same size...<br />
<br />
affirmatively then try this:<br />
<br />
put following piece of code within the <head></head> sections of your page:<br />
<br />
<br />
<script language="javascript"><br />
<!--<br />
<br />
function openPic(picName){<br />
newWin = window.open("","","height=200,width=200,toolbars=0,location=0,status=0,titlebar=no,scrolling=no");<br />
<br />
varHTML = "<html><head><title>Image: "<br />
varHTML += picName;<br />
varHTML += "</title></head><body><table cellspacing=0 cellpadding=0 border=2 width=100%>";<br />
varHTML += "<tr><td><img src='http://www.htmlforums.com/archive/index.php/"+picName+"' width=200 height=200>";<br />
varHTML += "</td></tr></table></body></html>";<br />
newWin.document.write(varHTML);<br />
newWin.document.close();<br />
}<br />
//--><br />
</script><br />
<br />
<br />
And then put following code into your links (A href tags) around your thumbnail images:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"openPic('/mydir/imgName1.gif')"><img name="flower" src=http://www.htmlforums.com/archive/index.php/"/mydir/imgName1Thumb.gif"></a><br />
<br />
if your image is located in a folder called 'pictures' and the image name is 'somepic.jpg' then your like would say:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"openPic('/pictures/somepic.jpg')"><img name="flower" src=http://www.htmlforums.com/archive/index.php/"/pictures/somepicThumb.jpg"></a><br />
<br />
E.g. the actual (large) picture you want to open, the url of same including directory information, file name, etc should go inside the single quotation marks in the openPic() function call.<br />
<br />
Hope above was clear...<!--content-->Kenneth.......thank you very much. I probably won't get to test it till sometime next week as I have a busy weekend coming.<br />
<br />
The reason that I had sized all of my images the same size would be so that if I could cut and paste it may have saved me some work. I want the window to be the size of the image and it looks as if you have the answer. I trust that this will run in IE and Netscape? Now all that I have to do is code it right and everything will be fine. Thank you again. One day I hope to learn more about websites but I'm afraid that I'm more of a photographer than a site designer. Steve<!--content-->I need to be sure; would someone please proof this. I have copied and pasted the code that Kenneth J. had told me to put between the <head></head> tags. Should I have keyed it in by hand? I think that I remember reading that javascript has to be all in one line with no returns etc.<br />
<br />
Second I'm showing below two lines of my code for two different thumbs layed out in a table. The first is my attempt to insert java and I must have done something wrong because it isn't working. I'm trying to preview it in arachnophiia and the window doesn't open. I haven't uploaded so you won't find it on my website. Here are the examples:<br />
<br />
<tr><br />
<td height= "126" width="90"> <a href=http://www.htmlforums.com/archive/index.php/"openPic('/http://www.skoffphoto.com/catwoman2.jpg')"><img name="Timberly" src=http://www.htmlforums.com/archive/index.php/"/http://www.skoffphoto.com/tcatwoman2.jpg"></a> </td><br />
<br />
<br />
<td height= "126" width="90"> <a href=http://www.htmlforums.com/archive/index.php/"catwoman3.jpg" target="_blank"><img src="tcatwoman3.jpg" alt= "Timberly"></a> </td><br />
<br />
The code for the second thumb is what I am currently using and it works. While trying to preview the effects of the javascript from my harddrive files using the directory name skoffphoto the thumbnail appears but the window doesn't open.<br />
<br />
Question 3: Does the img name value replace the alt tag? When I left the alt tag in place it showed up in the thumbnail...if I can still use it where would I place it?<br />
<br />
Last Question: Would I be better off if it is possible to use html to control the size of the target=_blank or secondary window that opens? I hate to be a pain as it is possible that the above code could work if I uploaded it. Any help would be appreciated. Steve<!--content--><tr><br />
<td height= "126" width="90"> <br />
<a href=http://www.htmlforums.com/archive/index.php/"javascript: openPic('http://www.skoffphoto.com/catwoman2.jpg')"><br />
<img name="Timberly" alt="Timberly" src=http://www.htmlforums.com/archive/index.php/"/http://www.skoffphoto.com/tcatwoman2.jpg"><br />
</a><br />
</td><br />
<br />
<td height= "126" width="90"> <br />
<a href=http://www.htmlforums.com/archive/index.php/"catwoman3.jpg" target="_blank"><br />
<img src=http://www.htmlforums.com/archive/index.php/"tcatwoman3.jpg" alt="Timberly"><br />
</a><br />
</td><br />
</tr><br />
<br />
<br />
Both will work, but see the change to the href property of the first link, e.g.:<br />
<a href=http://www.htmlforums.com/archive/index.php/"javascript: openPic('http://www.skoffphoto.com/catwoman2.jpg')"><br />
<br />
Next, please note that you can not control height/width of popup window with _blank. It will open to the size of the previously opened window.<!--content-->
 
Back
Top