|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi there,
I have a site with many bibliographic references. I made an html page with all of them, which I open in a popup, using anchors to navigate to the correct reference. My popup is fine, but I need it to come back on top of the opener page when a new link is cliqued, as there are many per page. I tried this: <a href="ref_bib.htm#xxvi" onclick="window.open(this.href, 'refwin', 'width=600,height=100' );return false;" target="refwin"> and: <a href="ref_bib.htm#xxvi" onclick="window.open(this.href, 'refwin', 'width=600,height=100' );return false; refwin.focus():" target="refwin"> I even tried making a function, but it did not work either: <script language="JavaScript"> function createwin() { open("ref_bib.htm#xxvi", "refwin", "width=600,height=100"); refwin.focus(); } </script> I called the function from the href. I'm baffled. Where should I put this "refwin.focus()"? Or am I in the wrong direction all together? ...onvalavoir ![]() |
|
#2
|
||||
|
||||
|
Use a function to do it, and try this:
Code:
function openWin(url, winname, features) {
x = window.open(url, winname, features)
x.focus()
}
Let me know how you go! |
|
#3
|
|||
|
|||
|
worked with some twiching
Thanks!
It worked great when the function parameters were removed as such: function openWin() { x = window.open(url, winname, features) x.focus() } And, since I have many references per page, I am passing the name of the htm file when calling the function as such: modified function: function openWin(ref) { x = window.open(ref, "winname", "features") x.focus() } calling the function: <a href="#" onclick="openWin('page.htm');"> Thanks again! I really appreciate such quick help. Onvalavoir |
|
#4
|
||||
|
||||
|
Ahh - no. leave my parameters in there. The window.open method takes 3 parameters. Using the 2nd (window name), and 3rd (window attributes, like width, height, scrollbars, menubars etc) allows your to control most elements of the window.
more info: http://devedge.netscape.com/library...ow.html#1202731 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Can't get myWindow.focus() to work |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|