Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > need some code help....

need some code help....
Thread Tools
Fresh-Faced Recruit
Join Date: Jan 2001
Location: England
Status: Offline
Reply With Quote
Sep 18, 2003, 04:07 AM
 
Hello All

I have been trying to figure out some code I got from a "view source" and as there is no contact address on this particular site, I cannot ask him how he did it. (http://www.tappy.info/showPicsForADay.php?dateID=2)

Quite simply, I'd like to modify what he has done, which is to have a number of small thumbnail images (40x40 pixels) on the left, and when you click on them, the main image is displayed on the right, which is a box 495x372 pixels.

Within the code there is the use of "displayPic.php" and "iFrame", neither of which I seem to have any bearing on what is displayed in this right hand larger image box......

I cannot see any evidence of JavaScript at work here, but I wonder if some of the code has been hidden. Perhaps it is Flash code.

It all looks quite simple on the browser, so I put it to anyone who has got this far......can you explain this code, or pass on a simpler version which creates the same effect?

Many, many thanks to all who put forward suggestions.


     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Sep 18, 2003, 09:36 AM
 
you'd need his/her actual php script. the one that's doing all the work. you only see html, because php is parsing the code, and outputting html

you could hard-code a similar page, and have the larger images as layers, which are hidden/shown, depending on which thumbnail is active
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Sep 18, 2003, 11:42 AM
 
His is a PHP script, but you can do that in JavaScript quite easily.

I did something similar when I sold my G4 here:

http://cgi.ebay.com/ws/eBayISAPI.dll...14912&rd=1

It's pretty straightforward and you're welcome to borrow it.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Sep 18, 2003, 12:41 PM
 
Do you just want to do the effect? Not the PHP part of it? If so, you just put in an iframe, label it with and id, and then have the thumbnails be links with target=[insert iframeID].
Travis Sanderson
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: England
Status: Offline
Reply With Quote
Sep 19, 2003, 07:11 AM
 
I'm new to php, and have stuck to html and JavaScript when writing pages for the web so far.

Just after the simple effect of what was produced....

I'll fathom out that code, Arkham_c' as well as investigating how an iframe with an id might work -thanks redJag, (fancy posting an example?!).

This might keep me busy for a while!

Thank you all for comments, I'll keep you posted...
     
Forum Regular
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Sep 19, 2003, 02:36 PM
 
Hi Daisy,

Why can't you use a simple frameset?

The result would be almost indistinguishable!
Piot
     
Senior User
Join Date: Dec 2002
Status: Offline
Reply With Quote
Sep 19, 2003, 06:30 PM
 
<A href="http://slashdot.org" target="myFrame">Go to slashdot!</A><br><br>

<iframe src="http://www.google.com/" name="myFrame" width=400 height=300 frameborder=1>
</iframe>

code:
&lt;A href="http://slashdot.org" target="myFrame"&gt;Go to slashdot!&lt;/A&gt;&lt;br&gt;&lt;br&gt;

&lt;iframe src="http://www.google.com/" name="myFrame" width=400 height=300 frameborder=1&gt;
&lt;/iframe&gt;
Travis Sanderson
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2