Need to pass the current window width to a PHP class which creates a slide show presentation. The presentation image sizes need calculated for all devices including mobile and smart phone (mobile web).
My workaround is using Output Buffering:
<php ob_start(); //starts buffering ?> <script> var wwidth = screen.width; document.write(wwidth): //output </script> <?php $windowwidth = ob_get_clean(); //works error_log("Window width is: ".$windowwidth); //continue on with the rest of the script ?>
Any alternative suggestions?
Thanks in advance
Edited by rwhite35, 17 March 2015 - 09:01 PM.