If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > I need some javascript help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-15-04, 12:59
MBJ MBJ is offline
Registered User
 
Join Date: Jul 2004
Posts: 24
I need some javascript help

I hope this is the right forum..

I need to open a window, and resize and reposition it in the onload() event. When I do this, the window opens in one location, and then jumps to the new location.

how can I prevent the "jump" from being so visible?

the code is :

function loadv() // called from the onload event.
{

if (document.all.VSel.value=="2") {

var t = document.all.tblData;

var iw;
if (navigator.appName == "Netscape") {
iw = window.parent.window.opener.window.innerWidth;
}
else {
iw=window.parent.window.opener.window.document.bod y.clientWidth;
}

window.resizeTo(t.offsetLeft + t.offsetWidth+50, t.offsetHeight + t.offsetTop + 50);

var w;
if (navigator.appName == "Netscape") {
w = window.innerWidth;
}
else {
w=document.body.clientWidth;
}

var l=(window.parent.window.opener.window.screenLeft + iw)-w;
window.moveBy(l, window.screenTop);
}
window.focus();
}
Reply With Quote
  #2 (permalink)  
Old 11-15-04, 20:24
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
This is actually the ASP forum, not JS, but here's my idea.. on the onLoad event, you launch the new window, then set the focus on the parent window to bring it back to the front covering your new window while it resizes and adjusts it's location, then sets the focus back on the child window after the window alteration is complete.

Never tried it, but another idea might be to try to set the size of the window to be really small, do the window location adjustment, then the resize...
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 11-17-04, 12:43
MBJ MBJ is offline
Registered User
 
Join Date: Jul 2004
Posts: 24
I tried both ideas - setting focus to the parent window while the window resizes, and setting the window size to a very small size - none of them worked!
Thanks anyway.
maybe i'll try the js group..
Reply With Quote
  #4 (permalink)  
Old 11-17-04, 19:03
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
Did they not work, or not work as expected?
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On