jwilh Posted December 13, 2006 Share Posted December 13, 2006 I dont know if its easier to use html, javascript or php for this. I want to automatically adjust the iframe size based on screen resolution. It is suppose to be a full page iframe but even when i set width and height to 100% it does not work. Link to comment https://forums.phpfreaks.com/topic/30460-auto-adjusting-iframes/ Share on other sites More sharing options...
jwilh Posted December 14, 2006 Author Share Posted December 14, 2006 I have tried using javascript and that does not work, does anyone have any other ideas that may work? Link to comment https://forums.phpfreaks.com/topic/30460-auto-adjusting-iframes/#findComment-140855 Share on other sites More sharing options...
trq Posted December 14, 2006 Share Posted December 14, 2006 Post some code. Link to comment https://forums.phpfreaks.com/topic/30460-auto-adjusting-iframes/#findComment-140871 Share on other sites More sharing options...
pr0x Posted December 14, 2006 Share Posted December 14, 2006 meh, php doesn't have any functions to detect screen size, you have to use javascript. Here's a snippet of code i made acouple months ago for that function.[code]var number = screen.width;var number2 = screen.height;if (number==800 && number2==600) {document.write ('\\Your code here'); }if (number==1024 && number2==768) {document.write ('\\your code here'); }else {document.write ('\\your code here');}[/code]pretty simple. Link to comment https://forums.phpfreaks.com/topic/30460-auto-adjusting-iframes/#findComment-140896 Share on other sites More sharing options...
jwilh Posted December 14, 2006 Author Share Posted December 14, 2006 Where do i place that and what is the "your code here" ? Link to comment https://forums.phpfreaks.com/topic/30460-auto-adjusting-iframes/#findComment-141097 Share on other sites More sharing options...
pr0x Posted December 14, 2006 Share Posted December 14, 2006 you place it on the main page, and the \\your code here refers to the actual website you want displayed.So for the 800x600 version of your website, copy and paste your code into the if (number==800 && number2==600) {document.write ('\\Your code here'); } section, and same with the other if statement. Link to comment https://forums.phpfreaks.com/topic/30460-auto-adjusting-iframes/#findComment-141112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.