click image, swap image elsewhere on page - how?

  • kingjeremy02
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9

Post 3+ Months Ago

Basic no doubt - but if you don't know how, it can be frustrating... :? I know it has to do with MM_swapImage

1. I have a thumbnail image - that swaps for an image on rollover
2. (I need...) OnClick that thumbnail to have another larger image appear elsewhere on the page (different cell of a table) - how would the code look for this?

a. Name of the place for the larger image is "stage" (only a spacer image occupies this space now)
b. Thumbnail is "photo-1s"
c. Rollover thumbnail is "photo-1TH"
d. Name of the larger image is "photo-1"

this is what I have so far, but it isn't working
Code: [ Select ]
<img src="assets/photo-1s.jpg" alt="Photo manipulation thumb 1" width="110" height="90" vspace="5" align="absbottom" id="Image1" onmouseover="MM_swapImage('Image1','','assets/photo-1TH.jpg',1)" onmouseout="MM_swapImgRestore()" onclick="MM_swapImage('assets/photo-1s.jpg','','assets/photo-1TH.jpg','Stage','','assets/photo-1.jpg',1)""/>

the code for the other cell looks like this
Code: [ Select ]
<tr><div><td height="275" valign="top" class="bodyText"><p><span class="style1"><img src="mm_spacer.gif" name="stage" width="304" height="1" border="0"/></td></div></tr>


Help would be much appreciated ! !
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • kingjeremy02
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9

Post 3+ Months Ago

Okay I'm getting closer ... but not there yet, anyone have a help??

Once I click the rollover image, the large image appears but the thumbnail disappears - I don't want the thumbnail to disappear while the disjointed larger image appears. onMouseout returns everything back to its original state.

What I'm after is a rollover on photo-1s to photo-1TH. But onclick, photo-1TH remains and "stage" is replaced with the larger "photo-1"

Here's the code as it sits now:

Code: [ Select ]
<img src="assets/photo-1s.jpg" alt="Photo manipulation thumb 1" width="110" height="90" vspace="5" align="absbottom" id="Photo1s" onmouseover="MM_swapImage('Photo1s','','assets/photo-1TH.jpg',1)" onmouseout="MM_swapImgRestore()""  onclick="MM_swapImage('stage','','assets/photo-1.jpg','Photo1s','','assets/stage_spacer.gif',1)"/>


I'm sure it's something easy I'm missing. :roll:
  • Dorky
  • Novice
  • Novice
  • Dorky
  • Posts: 15

Post 3+ Months Ago

it would require a page refresh but you could use php and pass the variable to a link then $_GET

<a href="http:yoursite.com?variablename=$variable">Link</a>

<?php
if(isset($_GET['variablename']))
{ $cell = $variable ; } else { $cell = $blankvariable ; }
?>

<td><?php include($cell); ?></td>

//$variable would need to be the url short or long.
//$blankvariable would be the url to the image or text shown on initial page load
//$cell well i think you can gather lol
  • kingjeremy02
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9

Post 3+ Months Ago

Someone suggested the solution might better lie in javascript

Having trouble making this work, been a real challenge for me so far. I'll try explaining the problem better below:

2 table cells – one cell houses 3 thumbnails, the other cell (called “stage”) is the target of the onClick content.
Thumbnail 1 = a block of text
Thumbnail 2 = an image
Thumbnail 3 = a Flash movie

The initial image on page load on the stage is a transparent gif called stage_spacer.gif


The thumbnails are a tri-state locking rollover ...ie:
Thumb1 = default state
Thumb1H = Hover state
Thumb1T = Clicked state


Quote:
How do I get the onClick action (Thumb1T) to change the content of “stage” (not just as a disjointed rollover, because I need the onClick content on “stage” to stick?


I’m not a javascripter, so I need help in setting this situation up in javascript. Any help would be muchly appreciated!
:(
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

This happened back in '07, too. Back then, speculation had it that DP's practices where something like link trading. But then again, it's just speculation. There was a lot of talk of link 'tipping' which was essentially click fraud. Same story, new year. :)

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 159 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.