Page 1 of 1
Javascript Popup Window in the HTML on a category/product
Posted: Wed Jun 08, 2016 4:57 am
by skinsfan99
I am trying to use JavaScript to display a popup window from either a category or product page. When I edit the HTML and add the following code the popup window works fine, but I am not getting the scroll bars. Why?
Here is my code:
<a onclick="MyWindow=window.open('
http://dev.perelandra-ltd.com/Bottle-Bu ... llbars=yes'); return false;" href="#">Click Here</a>
Thank you!!
Re: Javascript Popup Window in the HTML on a category/product
Posted: Wed Jun 08, 2016 8:21 am
by Katie
Hello,
Can you provide a link to the page that has this code added?
Thanks
Katie
Re: Javascript Popup Window in the HTML on a category/product
Posted: Wed Jun 08, 2016 10:45 am
by skinsfan99
Katie,
Here is the link:
http://dev.perelandra-ltd.com/Animal-Ca ... W5589.aspx
The 'Click Here' is at the very top. I just used this as a test page. Once it is working there are quite a few places where we will be implementing this feature.
Thank you!!
Re: Javascript Popup Window in the HTML on a category/product
Posted: Wed Jun 08, 2016 2:32 pm
by Katie
The pop-up scrolls if you use Google Chrome, but it doesn't if you use Firefox.
I'm not that familiar with Javascript. You might try to do some google searches to see if FF requires different code.
Thanks
Katie
Re: Javascript Popup Window in the HTML on a category/product
Posted: Tue Jun 14, 2016 6:10 am
by skinsfan99
Firefox does require a different syntax. You must supply a value for the href parameter.
Here is the updated code that now works on Firefox and IE. I also added code that centers the popup on the screen. If you don't want it centered use the second example.
Centered on screen:
<p><a onclick="window.open('/Bottle-Buyers-Club-Membership-C1218.aspx','license','width=1000px,height=600px,left=' + ((screen.width - 1000) / 2) + ',top=' + (screen.height - 600) / 2 + ',resizable=1,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no');;return false" href="/Bottle-Buyers-Club-Membership-C1218.aspx">Membership Subscription Agreement</a></p>
Not centered on screen:
<p><a onclick="window.open('/Bottle-Buyers-Club-Membership-C1218.aspx','license','width=1000px,height=600px,resizable=1,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no');;return false" href="/Bottle-Buyers-Club-Membership-C1218.aspx">Membership Subscription Agreement</a></p>
I hope this helps.
Thanks