Finally I've had some time, so I've been playing around with this popup window trying to make it work, and boy am I frustrated. NO matter what I cannot make it work, the way it should. I've borrowed pieces of code from other popup windows, even tried zen_colorbox and it worked on desktop, but failed on iPhone.
The most I was able to accomplish was enlarge the window to 452 x 393 pixels, funny numbers I have not the slightest idea where they come from. That was done by changing the includes/modules/pages/popup_coupon_help/jscript_main.php
from this
PHP Code:
<script type="text/javascript">
var i=0;
function resize() {
if (navigator.appName == 'Netscape') i=10;
if (document.images[0]) {
imgHeight = document.images[0].height+45-i;
imgWidth = document.images[0].width+30;
var height = screen.height;
var width = screen.width;
var leftpos = width / 2 - imgWidth / 2;
var toppos = height / 2 - imgHeight / 2;
window.moveTo(leftpos, toppos);
window.resizeTo(imgWidth, imgHeight);
}
self.focus();
}
</script>
to this
PHP Code:
<!--<script type="text/javascript">
var i=0;
function resize() {
if (navigator.appName == 'Netscape') i=10;
if (document.images[0]) {
imgHeight = document.images[0].height+45-i;
imgWidth = document.images[0].width+30;
var height = screen.height;
var width = screen.width;
var leftpos = width / 2 - imgWidth / 2;
var toppos = height / 2 - imgHeight / 2;
window.moveTo(leftpos, toppos);
window.resizeTo(imgWidth, imgHeight);
}
self.focus();
}
</script>-->
<script type="text/javascript">
function couponpopupWindow(url) {
window.open(url,'couponpopupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=320,screenX=150,screenY=150,top=150,left=150')
}
</script>
Even changing the width and height the window remains the same size 452 x 393 pixels.
I'm tempted to remove the link for the popup completely from the actual ot_coupon file, and leave it as a text as a reference of the code being used.
My limited php knowledge seems to be not enough to tackle this on my own. If someone could help me out, it would be really appreciated.
Bookmarks