window.open question

D

Dave

I'm running the below script to open a popup window. Works great!
I'd like to find out if there's a way to include Mouse Coordinates in
the top and left parameters so that when my button is clicked, the
popup opens in the same location.


protected void btnLocateEmpID_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("<script>");
sb.Append("window.open('LocateEmpID.aspx', '','toolbar=0,
height=320,width=375,resizable=0,scrollbars=0');");
sb.Append("</scri");
sb.Append("pt>");
Page.RegisterStartupScript("test", sb.ToString());
}



Please be as descriptive as possible with your reply.

Thanks for your help! ;-)
 
D

Dave

Peter, that link basically tells me what I already have in my original
posting. Thank you all the same. My Original Posting says that the
script I had worked Great. My original question...How Can I get
"Mouse Coordinates" (X,Y) to include them as Left and Top parameters
so that the popup window opens "where the button was clicked"? That
link doesn't provide that.
 
C

Chris Shepherd

Dave said:
Peter, that link basically tells me what I already have in my original
posting. Thank you all the same. My Original Posting says that the
script I had worked Great. My original question...How Can I get
"Mouse Coordinates" (X,Y) to include them as Left and Top parameters
so that the popup window opens "where the button was clicked"? That
link doesn't provide that.

It's kind of messy in implementation on a per-browser basis.

Scroll down until you see the Mouse Position heading.
http://www.quirksmode.org/js/events_properties.html


Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top