Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2005, 05:45 AM   PM User | #1
cursor_joe
New Coder

 
Join Date: Dec 2004
Location: Crown Point, IN
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
cursor_joe is an unknown quantity at this point
image help please

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?

PHP Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function 
doChange(opt){
var 
selobj=document.getElementById("piclist");
var 
idx=selobj.selectedIndex;
if(
opt=="back" && idx!=0idx--;
if(
opt=="next" && idx!=selobj.options.length-1idx++;
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> 
__________________
</stupid people>
joeratt.com -- for all your joeratt needs
cursor_joe is offline   Reply With Quote
Old 03-18-2005, 06:14 AM   PM User | #2
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
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?
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 03-18-2005, 12:33 PM   PM User | #3
cursor_joe
New Coder

 
Join Date: Dec 2004
Location: Crown Point, IN
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
cursor_joe is an unknown quantity at this point
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
__________________
</stupid people>
joeratt.com -- for all your joeratt needs
cursor_joe is offline   Reply With Quote
Old 03-18-2005, 10:59 PM   PM User | #4
cursor_joe
New Coder

 
Join Date: Dec 2004
Location: Crown Point, IN
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
cursor_joe is an unknown quantity at this point
does anyone know?
__________________
</stupid people>
joeratt.com -- for all your joeratt needs
cursor_joe is offline   Reply With Quote
Old 03-21-2005, 04:19 AM   PM User | #5
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Quote:
Originally Posted by cursor_joe
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.
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting 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

Forum Jump


All times are GMT +1. The time now is 11:59 AM.


Advertisement
Log in to turn off these ads.