Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Handy little popup trick

Handy little popup trick

Locked

Views: 1,977

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
20 Mar 2009, 7:02 PM
#1
r1formetoo avatar

r1formetoo

Zen Follower

Join Date:
Sep 2008
Posts:
429
Plugin Contributions:
0

Handy little popup trick

Well I'm finally going to contribute something back to the board. I'm attaching my code for my description that shows how to have pop ups for pictures and videos in your description. Of course this still requires making the pop up pages the good ole fashioned way but for most of us that's no big deal. Below you can view the page and the code.

Ian
http://www.redlinestands.com/catalog/dirt-bike-lifts-stands/pit-posse-dirt-bike-lift

<p align="justify"><font color="#FF0000"><font color="#000000">If you're looking for a well made dirt bike stand without the high price then you've found it. Introducing the Pit Posse universal moto cross dirt bike lift. This lift is fully adjustable to fit nearly every off road bike on the dirt today! You can view a dimensional diagram of the lift at it's high level setting by clicking <a href="javascript:openpopup1()">HERE</a> </font></font><font color="#000000">Still not convinced<font color="#FF0000"><font color="#000000">? See our bike lift </font> <a href="javascript:openpopup2()">VIDEO</a><strong><br> </strong></font></font><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><font color="#000000"><strong><br> KEY BENEFITS</strong></font></font><font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><br> <font color="#000000">• </font>Fully TIG welded<br> <font color="#000000">• </font>Thick rubber non-slip pad<br> <font color="#000000">• </font>Built in locking mechanism<br> <font color="#000000">• </font>Durable powder coated finish<br> <font color="#000000">• </font>Rugged 6061 aluminum construction<br> <font color="#000000">• </font>Tubing inserts leave edges unexposed<br> <font color="#000000">• </font>2 height levels: Low 11-15'' & 12.5-17.5'' <br> <font color="#000000">• </font>See all available colors </font><a href="javascript:openpopup3()"><font color="#FF0000">HERE</font></a><font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><br> </font></p>
                    <script>

function openpopup1(){
var popurl="http://www.redlinestands.com/pit-posse/pop-dirt-bike.htm"
winpops=window.open(popurl,"","width=600,height=600,")
}
function openpopup2(){
var popurl="http://www.redlinestands.com/pit-posse/pop-dirt-bike-video.htm"
winpops=window.open(popurl,"","width=700,height=500,")
}
function openpopup3(){
var popurl="http://www.redlinestands.com/pit-posse/pop-all-5-colors.htm"
winpops=window.open(popurl,"","width=650,height=500,")
}
</script>

17 May 2009, 9:05 PM
#2
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Handy little popup trick

Thanks! This is much easier than adding another one of Zen's popups, as on this thread- http://www.zen-cart.com/forum/showthread.php?t=110065.

While yours works fine in FireFox and Chrome, I see that in IE 8 it merely opens another window as a typical link. Do you know what's up with that?

Mine's a little different as I wanted a popup near one of the product atttributes. So the link is above the text box for "Card-message" seen on any product description page-

<a href="javascript:openpopup1()">More info, tips & quotes</a>

and then I put the other code at the very top (before <?php) of includes\templates\CUSTOM\templates\tpl_product_info_display.php

<script> function openpopup1(){ var popurl="/shipping_popup.html" winpops=window.open(popurl,"","width=400,height=400") } </script>

alexandergifts.ca ZC 1.38a

Cheers,

Robbie

17 May 2009, 9:16 PM
#3
giftmeister avatar

giftmeister

Zen Follower

Join Date:
Jan 2009
Location:
Montreal, Canada
Posts:
230
Plugin Contributions:
0

Re: Handy little popup trick

Sorry, I realized before I could delete this that the issue was a setting in IE and nothing to do with the code. (Tools, Options, General, Tabs...)

R

18 May 2009, 12:40 AM
#4
r1formetoo avatar

r1formetoo

Zen Follower

Join Date:
Sep 2008
Posts:
429
Plugin Contributions:
0

Re: Handy little popup trick

Well I'm glad you found my post helpful.

Ian