Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2004
    Location
    Crown Point, IN
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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> 

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    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?

  • #3
    New Coder
    Join Date
    Dec 2004
    Location
    Crown Point, IN
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New Coder
    Join Date
    Dec 2004
    Location
    Crown Point, IN
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts
    does anyone know?

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •