Open set size window from embedded email

S

Sean Berry

I have a news video that I am sending out for a client. There are embedded
links to flash movies in the email.

I want the popup to be a set size (400 x 400). I am currently using the
following code, but the popup window is not 400 x 400, it is whatever the
browser size was last time it was opened. How can I set the absolute size
from within this email?

Thanks.

### START CODE ###


<SCRIPT language=javascript type=text/javascript>
<!--
/**********************************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
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;TopPositi
on=(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,toolb
ar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->

function blurAnchors(){
if(document.getElementsByTagName){
var a = document.getElementsByTagName(a);
for(var i = 0; i < a.length; i++){
a.onfocus = function(){this.blur()};
}
}
}
window.onload = blurAnchors;

</SCRIPT>

<TABLE>
<TBODY>
<TR>
<TD width=400><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>
 
M

Martin Honnen

Sean Berry wrote:

I want the popup to be a set size (400 x 400). I am currently using the
following code, but the popup window is not 400 x 400, it is whatever the
browser size was last time it was opened. How can I set the absolute size
from within this email?
<TD width=400><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>

Probably there is no script enabled in the email client so that the link
is simply opened. Just a guess, but generally don't expect script in
HTML emails to work.
 
S

Sean Berry

How about... having a link in an email open a browser window... that page
opens a popup, then closes itself, leaving only the popup?

Any suggestions on code to open the popup automatically, then close the main
window?

Thanks...


Sean Berry said:
I have a news video that I am sending out for a client. There are embedded
links to flash movies in the email.

I want the popup to be a set size (400 x 400). I am currently using the
following code, but the popup window is not 400 x 400, it is whatever the
browser size was last time it was opened. How can I set the absolute size
from within this email?

Thanks.

### START CODE ###


<SCRIPT language=javascript type=text/javascript>
<!--
/**********************************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
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;TopPositi
on=(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,toolb
ar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->

function blurAnchors(){
if(document.getElementsByTagName){
var a = document.getElementsByTagName(a);
for(var i = 0; i < a.length; i++){
a.onfocus = function(){this.blur()};
}
}
}
window.onload = blurAnchors;

</SCRIPT>

<TABLE>
<TBODY>
<TR>
<TD width=400><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>
 
S

Sean Berry

I figured most of this out....

My only problem now is that when the code executes to close the window, in
IE on Win, it wants you to confirm closing the window.

Anyway to bypass this? It works great in IE on Mac.


Sean Berry said:
How about... having a link in an email open a browser window... that page
opens a popup, then closes itself, leaving only the popup?

Any suggestions on code to open the popup automatically, then close the main
window?

Thanks...


Sean Berry said:
I have a news video that I am sending out for a client. There are embedded
links to flash movies in the email.

I want the popup to be a set size (400 x 400). I am currently using the
following code, but the popup window is not 400 x 400, it is whatever the
browser size was last time it was opened. How can I set the absolute size
from within this email?

Thanks.

### START CODE ###


<SCRIPT language=javascript type=text/javascript>
<!--
/**********************************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
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()*((screenif(pos==center){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPositi
on=(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,toolb
ar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->

function blurAnchors(){
if(document.getElementsByTagName){
var a = document.getElementsByTagName(a);
for(var i = 0; i < a.length; i++){
a.onfocus = function(){this.blur()};
}
}
}
window.onload = blurAnchors;

</SCRIPT>

<TABLE>
<TBODY>
<TR>
<TD width=400><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,
etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>

 
G

Grant Wagner

Sean said:
<TD width=400><A onfocus=this.blur()

This is a "trick" used to avoid the dotted outline around links. However, using
this "trick" removes the possibility of using anything other then a mouse to
activate the link. Doing it with "this.blur()" is a bad design. Removing the
focus indicator at all is a bad design, but if you insist on doing it, the way
you are doing it should be replaced by:

<head>
<style type="text/css">
a:focus {
-moz-outline: none ! important;
}
</style>
<script type="text/javascript">
function hideFoci() {
var a;
if (document.getElementsByTagName) {
a = document.getElementsByTagName('a');
} else if (document.all && document.all.tags) {
a = document.all.tags('a');
}
if (a && a.length > 0 && typeof a[0].hideFocus != 'undefined') {
for (var i = 0; i < a.length; i++) {
a.hideFocus = true;
}
}
}
</script>
</head>
onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_high.htm"
false>Launch Home Time Video for Broadband, Cable, DSL,

I'm not sure why you've included an attribute of the <A> tag called "false" on
this link. I think you might have been modifying code and in fact meant:

onclick="NewWindow(this.href,'video','400','400','no','center');return false;"
href="...">Link text...

etc.</A></TD></TR>
<TR>
<TD>&nbsp;</TD></TR>
<TR>
<TD width=300><A onfocus=this.blur()

onclick="NewWindow(this.href,'video','400','400','no','center');return"
href="http://www.buildingonline.net/client/archwood/ht_low.htm"
false>Launch Home Time Video for dial-up 56k
modem.</A></TD></TR></TBODY></TABLE>

Remove the onfocus event handler and move the "false" for this link as well.

--
| Grant Wagner <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-developer/upgrade_2.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top