Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Javascript popup window


ashrafzia

Recommended Posts

THis is the coding for javascript popup window:

 

1)In product_info.php add ;

 

This is the JS code that works for any name you give the popup so you don't have to add additional code for each popup, just include this once and you are done this part.

 

<script language="javascript" type="text/javascript">
<!--
var open_window = false;
var new_window = null;

function openwindow(url,width,height,resizable,scrollbars,posx,posy)
{
if(posx==null) posx = 20;
if(posy==null) posy = 20;
now = new Date();
new_window=window.open(url, now.getHours()+now.getMinutes()+now.getSeconds(), 'width='+width+',height='+height+',resizable='+resizable+',scrollbars='+scrollbars+',screenY='+posy+',screenX='+posx+',top='+posy+',left='+posx);

try {
new_window.focus();
} catch(e) {}
}
//-->
</script>
</head>

 

2) In your admin add where you want the popup to be (in your product description section) ;

 

<a href="java script:openwindow('/your_popup.php', 450, 450, 0, 0)">What Ever Text</a>

 

Here in this step theres a problem. the link ('/sizechart.php', 450, 450, 0, 0) isn't working .

 

3) Create a page called catalog/popup_whatever.php

 

<!-- body //-->
<table width="450px" bgcolor="#663300" border="0" align="center" cellspacing="0" cellpadding="10">
<tr>
<!-- body_text //-->
<td class="main" align="center">
<b>What Ever Page Title</b><br />
<p align="left">
What ever page text<br />
</p>
<p class="smallText" align="center">
<?php echo '<a href="java script:window.close()">Close Window</a>'; ?>
</p> </td></tr></table>
</body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...