• 0

How can I shrink a website with HTML?


Question

I found the code below and I use it in a browser window that is kind of small. If I had a small screen size, is there any way I can make the webpages fit in the entire window without having scroll bars?

Basicly, I want to be able to resize the browser window and make the whole webpage shrink with it and stay one size with no scroll bars.

If I'm not making any sense, let me know and I'll post screen shots.

========================================================

<BODY vlink=black alink=black link=black text="black" leftMargin=0 topMargin=0 bgcolor="threedface" scroll=auto>

<form name="jumpy">

<select name="example" size="1" onChange="gone()">

<!-- CHANGE THE BELOW URLS TO YOUR OWN-->

<option value="http://www.yahoo.com" selected>Yahoo.com</option>

<option value="http://www.google.com">Google</option>

<option value="http://www.lycos.com">Lycos</option>

<option value="http://www.AltaVista.com">AltaVista</option>

</select>

<input type="button" name="test" value="Go!" onClick="gone()">

</form>

<script language="javascript">

<!--

//Drop-down Document Viewer- ? Dynamic Drive (www.dynamicdrive.com)

//For full source code, 100's more DHTML scripts, and TOS,

//visit http://www.dynamicdrive.com

//Specify display mode (0 or 1)

//0 causes document to be displayed in an inline frame, while 1 in a new browser window

var displaymode=0

//if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown

//var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.yahoo.com"></iframe>'

var iframecode='<iframe id="external" style="width:100%;height:100%" src="http://www.yahoo.com"></iframe>'

/////NO NEED TO EDIT BELOW HERE////////////

if (displaymode==0)

document.write(iframecode)

function gone(){

var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value

if (document.getElementById&&displaymode==0)

document.getElementById("external").src=selectedurl

else if (document.all&&displaymode==0)

document.all.external.src=selectedurl

else{

if (!window.win2||win2.closed)

win2=window.open(selectedurl)

//else if win2 already exists

else{

win2.location=selectedurl

win2.focus()

}

}

}

//-->

</script>

========================================================

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

using JScript: use the "onresizestart" event on your window to catch a window resize when it begins. save the window width or height and the current window.iframename.style.zoom value. use the "onresizeend" to read the new window properties. here you can adjust the zoom according to the width or height changes someone has made. proportionally of course. I dont have time to code that right now, but I think you got some pointers here to proceed.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.