Webmastersite.net
Register Log In

Useful jscript image display code

Title Useful jscript image display code
Description this might help someone out
Message Text (this might already be posted but, I couldn't find it anywhere) For my purposes, I wanted members album thumbnail images to display the fullsize image in a new pop-up window when clicked with none of the image editing features that link.php offers. Here's the code I used to get a new pop-up with no window controls, etc: <!-- BEGIN REGULAR IMAGES --> <td {IMAGEWIDTH} valign="top" class="link" align="center" onClick="window.open('download.php?id={IMAGEID}', 'Image_Display', 'width={IMAGEXWIDTH},height={IMAGEYHEIGHT},left=0,top=0,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1')" onMouseOver="this.style.cursor='hand'" onMouseOut="this.style.cursor='auto'"><IF {SWITCH_TITLES}><IF {IMAGETITLE}>{IMAGETITLE}<br> </IF></IF> <img src="thumbnail.php?id={IMAGEID}" border="0" {BORDEREFFECT} {MOUSEOVEREFFECT} alt="{IMAGEBOOKMARKTITLE}" onClick="window.open('download.php?id={IMAGEID}', 'Image_Display', 'width={IMAGEXWIDTH},height={IMAGEYHEIGHT},left=0,top=0,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1')" onMouseOver="this.style.cursor='hand'" onMouseOut="this.style.cursor='auto'"> <br> <IF {THISMEMBERCANREMOVE[{IMAGEOWNERID}]}><br> <a href="albums.php?action=remove&linkid={IMAGEID}&catid={CATID}">DELETE THIS IMAGE</a></IF> </td> <!-- END REGULAR IMAGES --> Note that width={IMAGEXWIDTH},height={IMAGEYHEIGHT} can be set to a fixed dimension, if you want the same size window each time. Here's the one drawback with using the X & Y dimensions from each image: the new window seems to put a 15px padding on the image so, you have to resize the window slightly to get the full image. I tried tinkering in download.php to add 25px or so onto each returned IMAGEXWIDTH IMAGEYHEIGHT to compensate for the padding but, no dice. Anyone know a hack for this?
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership knotworking
Views 542 views. Averaging 0 views per day.
Similar Topics
Submission Date May 07, 2005 - 9:27 AM