Jump to content

resizing a browser window in PHP


spikasso

Recommended Posts

Hi,
i am wondering if a function or a script similar to the Java ''ResizeTo'' function exist in PHP?
I have a slideshow script and i would like the browser window to resize to the next (or previous) picture when people click on the next or previous links.
I have looked on the web and many PHP help sites, but cannot find anything.
Worse come to worse and if this function does not exits, or there is no way to resize a browser window with php, can i use the variables from my php script in the java command? if so, how?

thanks in advance!
Link to comment
Share on other sites

Cannot do that. PHP Is a server side language. The browser knows absolutely nothing about the php going on.

PHP Just shoots text data back at the browser.

To do this just simply do some javascript to call a function onload
that will get the size of the current image in the image ID and resize to that

similiar to
[code]
<script>
function ResizeMe(imgid) {
// Im not sure of the proper image size code for JS, please check this!!
//Also check all function names and casing as im prolly typing it wrong!
width=document.getElementById(imgid).width + 50;
height=document.getElementById(imgid).height + 50;

window.resizeTo(width,height);
}
</script>
<body onload="ResizeMe('myimage')">
<img id='myimage' src='pictures.php?picture=1'>
<a href='next.php'>Next Picture</a>
[/code]

Hope you understand.

Just remember, HTML,CSS,JS, etc all run on the client side
PHP,ASP,etc run on the server side, and send data to the client.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.