Open set size window from embedded email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sean Berry

    Open set size window from embedded email

    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=javasc ript 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(mypag e,myname,w,h,sc roll,pos){
    if(pos==random) {LeftPosition=( screen.width)?M ath.floor(Math. random()*(scree n
    ..width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen
    ..height-h)-75)):100;}
    if(pos==center) {LeftPosition=( screen.width)?( screen.width-w)/2:100;TopPositi
    on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
    else if((pos!=center && pos!=random) ||
    pos==null){Left Position=0;TopP osition=20}
    settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ '
    ,scrollbars='+s croll+',locatio n=no,directorie s=no,status=no, menubar=no,tool b
    ar=no,resizable =no';
    win=window.open (mypage,myname, settings);}
    // -->

    function blurAnchors(){
    if(document.get ElementsByTagNa me){
    var a = document.getEle mentsByTagName( a);
    for(var i = 0; i < a.length; i++){
    a[i].onfocus = function(){this .blur()};
    }
    }
    }
    window.onload = blurAnchors;

    </SCRIPT>

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

    onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
    href="http://www.buildingonl ine.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.bl ur()

    onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
    href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
    false>Launch Home Time Video for dial-up 56k
    modem.</A></TD></TR></TBODY></TABLE>


  • Martin Honnen

    #2
    Re: Open set size window from embedded email



    Sean Berry wrote:

    [color=blue]
    > 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?[/color]
    [color=blue]
    > <TD width=400><A onfocus=this.bl ur()
    >
    > onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
    > href="http://www.buildingonl ine.net/client/archwood/ht_high.htm"
    > false>Launch Home Time Video for Broadband, Cable, DSL,
    > etc.</A></TD></TR>[/color]

    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.

    --

    Martin Honnen


    Comment

    • Sean Berry

      #3
      Re: Open set size window from embedded email

      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" <sean_berry@cox .net> wrote in message
      news:sohEc.1508 $876.1171@fed1r ead07...[color=blue]
      > I have a news video that I am sending out for a client. There are[/color]
      embedded[color=blue]
      > 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=javasc ript 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(mypag e,myname,w,h,sc roll,pos){
      >[/color]
      if(pos==random) {LeftPosition=( screen.width)?M ath.floor(Math. random()*(scree n[color=blue]
      >[/color]
      ..width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen[color=blue]
      > .height-h)-75)):100;}
      >[/color]
      if(pos==center) {LeftPosition=( screen.width)?( screen.width-w)/2:100;TopPositi[color=blue]
      > on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
      > else if((pos!=center && pos!=random) ||
      > pos==null){Left Position=0;TopP osition=20}
      >[/color]
      settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ '[color=blue]
      >[/color]
      ,scrollbars='+s croll+',locatio n=no,directorie s=no,status=no, menubar=no,tool b[color=blue]
      > ar=no,resizable =no';
      > win=window.open (mypage,myname, settings);}
      > // -->
      >
      > function blurAnchors(){
      > if(document.get ElementsByTagNa me){
      > var a = document.getEle mentsByTagName( a);
      > for(var i = 0; i < a.length; i++){
      > a[i].onfocus = function(){this .blur()};
      > }
      > }
      > }
      > window.onload = blurAnchors;
      >
      > </SCRIPT>
      >
      > <TABLE>
      > <TBODY>
      > <TR>
      > <TD width=400><A onfocus=this.bl ur()
      >
      > onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
      > href="http://www.buildingonl ine.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.bl ur()
      >
      > onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
      > href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
      > false>Launch Home Time Video for dial-up 56k
      > modem.</A></TD></TR></TBODY></TABLE>
      >
      >[/color]


      Comment

      • Sean Berry

        #4
        Re: Open set size window from embedded email

        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" <sean_berry@cox .net> wrote in message
        news:MTkEc.1670 $876.1026@fed1r ead07...[color=blue]
        > 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[/color]
        main[color=blue]
        > window?
        >
        > Thanks...
        >
        >
        > "Sean Berry" <sean_berry@cox .net> wrote in message
        > news:sohEc.1508 $876.1171@fed1r ead07...[color=green]
        > > I have a news video that I am sending out for a client. There are[/color]
        > embedded[color=green]
        > > links to flash movies in the email.
        > >
        > > I want the popup to be a set size (400 x 400). I am currently using[/color][/color]
        the[color=blue][color=green]
        > > following code, but the popup window is not 400 x 400, it is whatever[/color][/color]
        the[color=blue][color=green]
        > > browser size was last time it was opened. How can I set the absolute[/color][/color]
        size[color=blue][color=green]
        > > from within this email?
        > >
        > > Thanks.
        > >
        > > ### START CODE ###
        > >
        > >
        > > <SCRIPT language=javasc ript 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(mypag e,myname,w,h,sc roll,pos){
        > >[/color]
        >[/color]
        if(pos==random) {LeftPosition=( screen.width)?M ath.floor(Math. random()*(scree n[color=blue][color=green]
        > >[/color]
        >[/color]
        ..width-w)):100;TopPosi tion=(screen.he ight)?Math.floo r(Math.random() *((screen[color=blue][color=green]
        > > .height-h)-75)):100;}
        > >[/color]
        >[/color]
        if(pos==center) {LeftPosition=( screen.width)?( screen.width-w)/2:100;TopPositi[color=blue][color=green]
        > > on=(screen.heig ht)?(screen.hei ght-h)/2:100;}
        > > else if((pos!=center && pos!=random) ||
        > > pos==null){Left Position=0;TopP osition=20}
        > >[/color]
        >[/color]
        settings='width ='+w+',height=' +h+',top='+TopP osition+',left= '+LeftPosition+ '[color=blue][color=green]
        > >[/color]
        >[/color]
        ,scrollbars='+s croll+',locatio n=no,directorie s=no,status=no, menubar=no,tool b[color=blue][color=green]
        > > ar=no,resizable =no';
        > > win=window.open (mypage,myname, settings);}
        > > // -->
        > >
        > > function blurAnchors(){
        > > if(document.get ElementsByTagNa me){
        > > var a = document.getEle mentsByTagName( a);
        > > for(var i = 0; i < a.length; i++){
        > > a[i].onfocus = function(){this .blur()};
        > > }
        > > }
        > > }
        > > window.onload = blurAnchors;
        > >
        > > </SCRIPT>
        > >
        > > <TABLE>
        > > <TBODY>
        > > <TR>
        > > <TD width=400><A onfocus=this.bl ur()
        > >
        > > onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
        > > href="http://www.buildingonl ine.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.bl ur()
        > >
        > > onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
        > > href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
        > > false>Launch Home Time Video for dial-up 56k
        > > modem.</A></TD></TR></TBODY></TABLE>
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Grant Wagner

          #5
          Re: Open set size window from embedded email

          Sean Berry wrote:
          [color=blue]
          > <TD width=400><A onfocus=this.bl ur()[/color]

          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.getEl ementsByTagName ) {
          a = document.getEle mentsByTagName( 'a');
          } else if (document.all && document.all.ta gs) {
          a = document.all.ta gs('a');
          }
          if (a && a.length > 0 && typeof a[0].hideFocus != 'undefined') {
          for (var i = 0; i < a.length; i++) {
          a[i].hideFocus = true;
          }
          }
          }
          </script>
          </head>
          <body onload="hideFoc i();">

          [color=blue]
          > onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
          > href="http://www.buildingonl ine.net/client/archwood/ht_high.htm"
          > false>Launch Home Time Video for Broadband, Cable, DSL,[/color]

          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="NewWin dow(this.href,' video','400','4 00','no','cente r');return false;"
          href="...">Link text...

          (ie - move the word false from it's position as an attribute of the <A> tag to
          be the value returned by the onclick event)
          [color=blue]
          > etc.</A></TD></TR>
          > <TR>
          > <TD>&nbsp;</TD></TR>
          > <TR>
          > <TD width=300><A onfocus=this.bl ur()
          >
          > onclick="NewWin dow(this.href,' video','400','4 00','no','cente r');return"
          > href="http://www.buildingonl ine.net/client/archwood/ht_low.htm"
          > false>Launch Home Time Video for dial-up 56k
          > modem.</A></TD></TR></TBODY></TABLE>[/color]

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

          --
          | Grant Wagner <gwagner@agrico reunited.com>

          * Client-side Javascript and Netscape 4 DOM Reference available at:
          *


          * Internet Explorer DOM Reference available at:
          *
          Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


          * 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-deve...upgrade_2.html


          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Open set size window from embedded email

            Sean Berry wrote:[color=blue]
            > 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?[/color]

            <news:40ED36A1. 2000207@Pointed Ears.de>
            [color=blue]
            > It works great in IE on Mac.[/color]

            So IE on Mac is borken.
            [color=blue]
            > [Top post][/color]

            <http://jibbering.com/faq/#FAQ2_3>


            PointedEars

            Comment

            Working...