spikasso Posted April 4, 2006 Share Posted April 4, 2006 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! Quote Link to comment https://forums.phpfreaks.com/topic/6562-resizing-a-browser-window-in-php/ Share on other sites More sharing options...
DrDre Posted April 4, 2006 Share Posted April 4, 2006 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 onloadthat will get the size of the current image in the image ID and resize to thatsimiliar 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 sidePHP,ASP,etc run on the server side, and send data to the client. Quote Link to comment https://forums.phpfreaks.com/topic/6562-resizing-a-browser-window-in-php/#findComment-23794 Share on other sites More sharing options...
spikasso Posted April 4, 2006 Author Share Posted April 4, 2006 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!!!! Quote Link to comment https://forums.phpfreaks.com/topic/6562-resizing-a-browser-window-in-php/#findComment-23795 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.