...

View Full Version : image help please



cursor_joe
03-18-2005, 06:45 AM
this is my code, and it works great. But now, when the picture changes, the select and buttons move around with it. Is there a way to postion the bottom of the image so that the select and buttons dont move?



<SCRIPT LANGUAGE="JavaScript">
<!--
function doChange(opt){
var selobj=document.getElementById("piclist");
var idx=selobj.selectedIndex;
if(opt=="back" && idx!=0) idx--;
if(opt=="next" && idx!=selobj.options.length-1) idx++;
selobj.selectedIndex=idx;
document.getElementById("mypic").src=selobj.options[idx].value;
window.status=selobj.options[idx].id;
return true;
}
//-->
</SCRIPT>
</HEAD>

<BODY background="swab.gif" link="maroon"><center>

<p><img id="mypic" src="pic1.jpg"></p>
<input type="button" value="back" onclick='doChange("back")'>

<SELECT id="piclist" onchange='doChange("selected")'>
<option value="pic1.jpg" id="picture 1">Pic1</option>
<option value="pic2.jpg" id="picture 2">Pic2</option>
<option value="pic3.jpg" id="picture 3">Pic3</option>
<option value="whole_world.gif" id="the globe">Globe</option>
<option value="http://www.iflta.org/images/2003_poster_contest_winner.jpg" id="2003 winner">Winner</option>
</SELECT>
<input type="button" value="next" onclick='doChange("next")'>
<p><a href='javascript:window.close();'>Close Window</a></p>



</center></BODY>
</HTML>

glenngv
03-18-2005, 07:14 AM
Specify the height of the largest image as the height of the container of the image.

<div style="height:100px"><img id="mypic" src="pic1.jpg"></div>

But you will have big space for small images. Why not just put the image below the buttons?

cursor_joe
03-18-2005, 01:33 PM
actually that's what i was looking for to an extent... is there a way for the image to be positioned at the bottom and grow up instead of being at the top and growing down?(its not really growing, its just that the height is getting bigger

cursor_joe
03-18-2005, 11:59 PM
does anyone know?

glenngv
03-21-2005, 05:19 AM
is there a way for the image to be positioned at the bottom and grow up instead of being at the top and growing down?
Just put the image tag at the bottom of the page.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum