Jump to content

New window focus....


twinkletoes

Recommended Posts

Hi,I have a problem with my site. I have links on the main page which open up a new sized window when you click on them. USing the code below:A HREF="java script:void(0)"onclick="window.open('newpage.html','linkname','height=400, width=700,scrollbars=yes')"These links open the window up fine, however, if the user doesn't close the window but clicks on the main window then tries another link, the content of the new window changes but it stays in the background. I want it to come to the front of the page so the user can read it!! I think its something to do with focus of the new window.....but i'm not really sure.I would be grateful for any help on this as its driving me crazy!!Thanks......

Link to comment
Share on other sites

Hi,I have a problem with my site. I have links on the main page which open up a new sized window when you click on them. USing the code below:A HREF="java script:void(0)"onclick="window.open('newpage.html','linkname','height=400, width=700,scrollbars=yes')"These links open the window up fine, however, if the user doesn't close the window but clicks on the main window then tries another link, the content of the new window changes but it stays in the background. I want it to come to the front of the page so the user can read it!! I think its something to do with focus of the new window.....but i'm not really sure.I would be grateful for any help on this as its driving me crazy!!Thanks......

Try this:<script>var windowReference;function go(){windowReference = window.open('newpage.html','linkname','height=400, width=700,scrollbars=yes')}function focus(){windowReference.self.focus()}</script><body><A HREF="java script:go()">Open page</a><A HREF="java script:focus()">Focus page</a></body>
Link to comment
Share on other sites

Or this:<script>var windowReference;function go(){windowReference = window.open('newpage.html','linkname','height=400, width=700,scrollbars=yes');windowReference.focus();}</script><body><A HREF="java script:go()">Open page</a></body>

Try this:<script>var windowReference;function go(){windowReference = window.open('newpage.html','linkname','height=400, width=700,scrollbars=yes')}function focus(){windowReference.self.focus()}</script><body><A HREF="java script:go()">Open page</a><A HREF="java script:focus()">Focus page</a></body>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...