PDA

View Full Version : Pop up Window



bosskax
03-08-2007, 10:38 AM
1) Script Title: Pop up window generator

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/popwin.htm

3) Describe problem: Its works in Firefox and Opera but not in IE7

any tips?

codeexploiter
03-08-2007, 11:09 AM
It works for me in IE 7. You can check out the code i've used in my machine furnished below:



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript" type="text/javascript">
<!--
/****************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
This script is free to use as long as this info is left in
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
</head>

<body>
<a href="http://www.google.com" onclick="NewWindow(this.href,'mywin','760','360','yes','center');return false" onfocus="this.blur()">YourLinkText</a>
</body>
</html>

bosskax
03-08-2007, 11:22 AM
heres the code I'm adding it to, see if it reacts differently in yours:

<!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<html><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title> MSc Responsibility in Business Practice</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="description" -->
<meta name="Description" content="" />
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="keywords" -->
<meta name="Keywords" content="" />
<script language="javascript" type="text/javascript">
<!--
/****************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
This script is free to use as long as this info is left in
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
<style type="text/css">
<!--
div.MsoNormal {mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:PMingLiU;}
div.MsoPlainText {mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:PMingLiU;}
li.MsoNormal {mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:PMingLiU;}
li.MsoPlainText {mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:PMingLiU;}
p.MsoNormal {mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:PMingLiU;}
p.MsoPlainText {mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:PMingLiU;}
-->


</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script><!-- InstanceEndEditable -->
<style type="text/css">

body
{
font-family: arial, helvetica, sans-serif;
}

h1
{
color: #285C96;
}

table#mainTable
{
width: 100&#37;;
}

table#mainTable tr
{
vertical-align: top;
}

table#mainTable td.editable
{
padding: 5px;
background-color: #F5F5F5;
}

table#mainTable td.description
{
background-color: #E5EDF5;
width: 30%;
font-size: 0.8em;
border: 1px solid #000;
}

table#mainTable td.description h2
{
font-weight: bold;
font-size: 1em;
color: #FFF;
background-color: #285C96;
margin: 0;
padding: 3px;
text-align: center;

background-repeat:no-repeat;
background-position: left center;
}

table#mainTable td.description p
{
padding: 3px;
margin-top: 0;
}
.highlight
{
color: #0000FF
}

.tagline
{
font-weight: bold;
}

tr.odd
{
background-color: #CCCCCC;
}

table td.blank,
table.blank td
{
border: none;
}
#lostList li
{
list-style: none;
display: inline;
padding: 3px;
}
#content img.header
{
float: right;
margin: 0 0 1em 1em;
}

</style>
</head>
<body>
<h1>Stuff</h1>
<p>The content inserted into the editable sections below are siphoned by the
system<br />
and formatted using the associated css files. If you are seeing this text
in your web browser,<br />
the system is not configured properly or the file extension is not configured
in the .htaccess.</p>
<table id="mainTable">
<tr>
<td class="editable"> <h2>
<!-- InstanceBeginEditable name="page header" -->
MSc in Responsibility and Business Practice<img src="../images/graphics/EQUIS_logo_sml.jpg" alt="Equis Logo" width="50" height="34" align="right" /> <!-- InstanceEndEditable --> </h2> </td>
<td class="description"> <h2>Page Header</h2>
<p>The main header of the page. </p></td>
</tr>
<tr>
<td class="editable"> <!-- InstanceBeginEditable name="header menu" --><!-- #BeginLibraryItem "/Library/Header Menu.lbi" -->
<ul class="menu">
<li class="first"><a href="http://www.bath.ac.uk/management">School of Management</a> </li>
<li><a href="http://www.bath.ac.uk/">University</a></li>
<li><a href="/management/_search/">Search</a></li>
<li><a href="/management/news_events/">News</a></li>
<li><a href="/management/az.html">A-Z Index</a></li>
<li class="last"><a href="/management/about/who_contact.html">Contact</a></li>
<li><a href="/cgi-bin/parser.cgi">Text Only</a></li>
</ul>
<!-- #EndLibraryItem --><!-- InstanceEndEditable --> </td>
<td class="description"> <h2>Header Menu</h2>
<p></p></td>
</tr>
<tr>
<td class="editable"> <!-- InstanceBeginEditable name="top menu" --><!-- #BeginLibraryItem "/Library/Top_Menu_MSc.lbi" -->
<ul class="menu">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">MSc in Responsibility and Business Practice</a></li>
</ul>
<!-- #EndLibraryItem --><!-- InstanceEndEditable --> </td>
<td class="description"> <h2>Top Menu </h2>
<p>This is the navigation which is placed in the bar at the top of the page. This should also be consistent throughout the site. </p></td>
</tr>
<tr>
<td class="editable"> <!-- InstanceBeginEditable name="main menu" --><!-- #BeginLibraryItem "/Library/mscresp.lbi" -->
<ul class="menu">
<li><a href="index.html">MSc in Responsibility and Business Practice</a></li>
<li><a href="innovations.html">An innovative course </a></li>
<li><a href="what_action.html">What is action research?</a></li>
<li><a href="overview.html">Course overview </a></li>
<li><a href="aims.html">Aims &amp; benefits </a></li>
<li><a href="why_resp.html">Why responsibility?</a></li>
<li><a href="who_for.html">Who is the course for?</a></li>
<li><a href="workshops/index.html">Workshops</a></li>
<li><a href="assessment.html">How is the course assessed? </a></li>
<li><a href="staff.html">Tutor profiles</a></li>
<li><a href="background.html">Background</a> </li>
<li><a href="comments.html">Student feedback</a></li>
<li><a href="admissions.html">Workshops and Open Days 2007</a> </li>
<li><a href="admissions.html">How do I apply? </a></li>
<li><a href="../pdf/MSc_Brochure.pdf">Download a brochure</a></li>
<li><a href="admissions.html#information">Contact Us </a></li>
</ul>
<!-- #EndLibraryItem --><!-- InstanceEndEditable --> </td>
<td class="description"> <h2>Main Menu </h2>
<p>This is the main menu for the page. It is displayed to the left of the page content.</p>
<p>Nest lists within each other to show heirarchy of the menu.</p></td>
</tr>
<tr>
<td class="editable"> <!-- InstanceBeginEditable name="content" -->
<p><img src="../images/msc_logo.jpg" alt="MSc Logo" width="200" height="141" align="right" /></p>
<p>blar blar<br />
<a href="http://www.bath.ac.uk/management/courses/mba/cd/judi.html" onClick="NewWindow(this.href,'Judi Marshall','250','220','yes','center');return false" onFocus="this.blur()"><img src="../images/video_icon1.gif" width="300" height="72" border="0" align="left"></a>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><em>&quot;test in here&quot;.</em><br />
<strong>Rooke, D &amp; Torbert, W.L. 'Seven Transformations of Leadership' </strong><strong><em>Harvard Business Review,</em></strong>
<strong>April 2005, pp 66-76</strong></p>
<!-- InstanceEndEditable --> </td>
<td class="description"> <h2>Main page content </h2>
<p>This is the main content for the page </p></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>