|
|
|
|
![]() ![]() |
![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 78 Joined: 25-April 05 Member No.: 6,158 |
Post
#1
May 13 2005, 05:52 PM
Hi, Need help designing a thumbnail page in frontpage. Need to have about six thumbnails aligned on the right hand side, and when you put the mouse over the thumbnail you can preview the image on the same page (as opposed to previewing it in a new window). Does anyone know a good way to do this? |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 1,203 Joined: 25-March 05 Member No.: 4,883 |
Post
#2
May 13 2005, 07:40 PM
You will have to be familiar with javascript because javascript is the one playing the role of switching pictures. I've created a sample for you according to your specifications. CODE <html> <head> <title>New Page 1</title> <script language="javascript"> function pictureA { document.preview.src = "1.jpg"; } function pictureB { document.preview.src = "2.jpg"; } function pictureC { document.preview.src = "3.jpg"; } function pictureD { document.preview.src = "4.jpg"; } function pictureE { document.preview.src = "5.jpg"; } function pictureF { document.preview.src = "6.jpg"; } </script> </head> <body> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="50%" rowspan="6"><img src="" name="preview" width="800" height="600"></td> <td width="50%"><img src="1.jpg" width="320" height="240" onmouseover="javascript:pictureA();"></td> </tr> <tr> <td width="50%"><img src="2.jpg" width="320" height="240" onmouseover="javascript:pictureB();"></td> </tr> <tr> <td width="50%"><img src="3.jpg" width="320" height="240" onmouseover="javascript:pictureC();"></td> </tr> <tr> <td width="50%"><img src="4.jpg" width="320" height="240" onmouseover="javascript:pictureD();"></td> </tr> <tr> <td width="50%"><img src="5.jpg" width="320" height="240" onmouseover="javascript:pictureE();"></td> </tr> <tr> <td width="50%"><img src="6.jpg" width="320" height="240" onmouseover="javascript:pictureF();"></td> </tr> </table> </body> </html> Hope it helps... |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 156 Joined: 14-March 05 From: Washington, USA Member No.: 4,520 |
Post
#3
May 13 2005, 10:59 PM
another code: CODE <script> //<!-- //<![CDATA[ first = 1; last = 16; current = 1; function nextPicture() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; // Show next picture, if last, loop back to front if (current == last) { current = 1; } else { current++ } object = document.getElementById('slide' + current); object.style.display = 'block'; } function previousPicture() { // Hide current picture object = document.getElementById('slide' + current); object.style.display = 'none'; if (current == first) { current = last; } else { current--; } object = document.getElementById('slide' + current); object.style.display = 'block'; } //]]> // --> </script> <div class="slideShow"> <div class="setTitle">Family</div> <div id="slide1" class="slides"> <div class="slideTitle">01</div> <img src="family/01.gif" height="300" width="400" border="0" /> </div> <div id="slide2" class="slides"> <div class="slideTitle">02</div> <img src="family/02.gif" height="300" width="400" border="0" /> </div> <div id="slide3" class="slides"> <div class="slideTitle">03</div> <img src="family/03.gif" height="300" width="400" border="0" /> </div> <div id="slide4" class="slides"> <div class="slideTitle">04</div> <img src="family/04.gif" height="300" width="400" border="0" /> </div> <div id="slide5" class="slides"> <div class="slideTitle">05</div> <img src="family/05.gif" height="300" width="400" border="0" /> </div> <div id="slide6" class="slides"> <div class="slideTitle">06</div> <img src="family/06.gif" height="300" width="400" border="0" /> </div> <div id="slide7" class="slides"> <div class="slideTitle">07</div> <img src="family/07.gif" height="300" width="400" border="0" /> </div> <div id="slide8" class="slides"> <div class="slideTitle">08</div> <img src="family/08.gif" height="300" width="400" border="0" /> </div> <div id="slide9" class="slides"> <div class="slideTitle">09</div> <img src="family/09.gif" height="300" width="400" border="0" /> </div> <div id="slide10" class="slides"> <div class="slideTitle">10</div> <img src="family/10.gif" height="300" width="400" border="0" /> </div> <div id="slide11" class="slides"> <div class="slideTitle">10</div> <img src="family/11.gif" height="300" width="400" border="0" /> </div> <div id="slide12" class="slides"> <div class="slideTitle">10</div> <img src="family/12.gif" height="300" width="400" border="0" /> </div> <div class="controls"> <a href="javascript:previousPicture()" style="margin: 10px; color: #888888;">< Previous</a> <a href="javascript:nextPicture()" style="margin: 10px; color: #888888;">Next ></a> </div> </div> Kinda confusing, but I like it a ton, but don't use .gif images, use jpg |
![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 78 Joined: 25-April 05 Member No.: 6,158 |
Post
#4
May 14 2005, 04:10 AM
Hi, I tried Inspirion's code. Thanks! I cannot get the large picture to show. Any ideas? |
![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 78 Joined: 25-April 05 Member No.: 6,158 |
Post
#5
May 14 2005, 04:37 AM
OK...so the error reads "Object expected" for this line: <td width="50%"><img src="5.JPG" width="320" height="240" onmouseover="javascript:pictureE();"></td> And all the other lines that are like it. Any help is totally appreciated. Thanks. |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Admin
Posts: 3,696 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 myCENT:19.60 |
Post
#6
May 14 2005, 05:38 AM
If you are referring to Inspiron's code (which is excellent by the way), it's missing () after each called function. QUOTE(Inspiron) HTML function pictureA() { document.preview.src = "1.jpg"; } As you can see it's perfect if you add () at the end of each called function. Few suggestion I would make is that the small thumbnail images should be on the left hand side with either cell padding or border AND the larger image on the right hand side. I am going to use Inspiron's code. I think I'll modify it so that a function called can have automatic incremental (so I don't have to type 1, 2, 3...it can be unlimited number of pictures and a single if then else would take care of it) nickmealey your coding did not work as requested. Nice coding, however. Keep up the good work! |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 1,203 Joined: 25-March 05 Member No.: 4,883 |
Post
#7
May 14 2005, 07:14 AM
Oh ... Thanks BuffaloHELP for discovering my errors... I didn't know that as I was typing... You know I always like to write my codes up to scratch.. Hope it helped you, fsoftball... |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Admin
Posts: 3,696 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 myCENT:19.60 |
Post
#8
May 14 2005, 08:02 AM
QUOTE(Inspiron @ May 14 2005, 03:14 AM) I didn't know that as I was typing... You know I always like to write my codes up to scratch.. [right][snapback]141291[/snapback][/right] You are what we (the OG's) used to call, "the free coders." You have all the codes in your head and the fingers cannot just keep up with your mind. LOL. You youngens, write 'em codeboys, write 'em! (spin-off of Ride 'em cowboys). |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 1,203 Joined: 25-March 05 Member No.: 4,883 |
|
![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 78 Joined: 25-April 05 Member No.: 6,158 |
Post
#10
May 16 2005, 06:49 AM
Perfect! Outstanding! The missing () were the problem. Thank you all for your generous help.
|
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | ||
|---|---|---|---|---|---|---|
![]() |
2 | odomike | 773 | 19th August 2004 - 07:33 AM Last post by: odomike |
||
![]() |
3 | zer000s | 318 | 12th April 2008 - 10:54 AM Last post by: the need for speed |
||
![]() |
5 | ipunto21 | 466 | 14th October 2004 - 07:57 PM Last post by: sohahm |
||
![]() |
0 | clouds421 | 436 | 26th September 2004 - 01:11 AM Last post by: clouds421 |
||
![]() |
10 | Lyon | 2,057 | 26th March 2008 - 03:38 PM Last post by: FeedBacker |
||
![]() |
3 | DMA | 326 | 25th October 2004 - 01:02 AM Last post by: MuTeD |
||
![]() |
7 | alapidus | 558 | 2nd November 2004 - 10:54 PM Last post by: kelp |
||
![]() |
1 | MacFly | 526 | 16th November 2004 - 11:01 AM Last post by: LuciferStar |
||
![]() |
0 | masugidsk8r | 2,916 | 10th June 2007 - 05:56 AM Last post by: masugidsk8r |
||
![]() |