A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] Popup Window Q.?

Threaded View

  1. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    I'd suggest you avoid working with frames to teach yourself. They're deprecated, and have a host of usability issues. I'd also suggest avoiding opening new windows. New windows also have usability problems, and guess at your user's intention. They may not want to open the link in a sized window. If you want to present information without leaving the page, it's typically better to create an element that's part of that page that appears and disappears.

    But since you asked...

    You can't just put say, 50% into your window opening code. If you want to open it at a percentage of the screen size, you'd have to detect the screen size in javascript and then use that in your window opening code.

    For example:

    Code:
    <script>
    	function openWindow(){
    		var winWidth=screen.width*.5;
    		var winHeight=screen.height*.5;
    		window.open('http://www.google.com','popWin','width='+winWidth+',height='+winHeight+'');
    	}
    </script>
    <a href="#" onclick="openWindow()">Google</a>
    Last edited by rdoyle720; 03-07-2012 at 12:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center