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!!
Javascript Popup Window in the HTML on a category/product
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 45
- Joined: Wed May 25, 2016 3:32 am
Re: Javascript Popup Window in the HTML on a category/product
Hello,
Can you provide a link to the page that has this code added?
Thanks
Katie
Can you provide a link to the page that has this code added?
Thanks
Katie
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 45
- Joined: Wed May 25, 2016 3:32 am
Re: Javascript Popup Window in the HTML on a category/product
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!!
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
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
I'm not that familiar with Javascript. You might try to do some google searches to see if FF requires different code.
Thanks
Katie
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 45
- Joined: Wed May 25, 2016 3:32 am
Re: Javascript Popup Window in the HTML on a category/product
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
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