Jump to content

Archived

This topic is now archived and is closed to further replies.

spikasso

resizing a browser window in PHP

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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
ahh, ok, i was hoping not to have to mix java and PHP.

i will have alook at the script and add it to the slideshow,

thanks a lot!!!!

Share this post


Link to post
Share on other sites

×

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.