Click to See Complete Forum and Search --> : Pop-ups set to certain size
musicfreaks
04-05-2003, 06:47 PM
I'm trying to create my page and on one part i want it, so when they click a link it opens a popup that is set to a certain size without all the extra browser stuff. I've seen in done before but im not sure how to do it. If someone could help me out, if it's not that hard to do it. If it is hard to do please let me know so i can figure out someother way to do this.
Thanks!!
khalidali63
04-05-2003, 06:54 PM
See if this helps
http://68.145.35.86/skills/javascripts/CentralizedPopupWindow.html
Cheers
Khalid
musicfreaks
04-05-2003, 07:05 PM
Thanks for the help but i'm looking for one where I can set the size of the window.
Thanks again.
khalidali63
04-05-2003, 07:07 PM
Look at the code you will see that how I have sized the window to a smaller size.
Cheers
Khalid
musicfreaks
04-05-2003, 07:14 PM
Cool, I got it now,
THANKS A LOT!!
musicfreaks
04-05-2003, 07:47 PM
Ok so i got the pop-up and can adjust the size. Now how do I adjust whats in the window depending on what link is clicked?
khalidali63
04-06-2003, 07:58 AM
If you have way too many links and the data you want to print in popup window is reallly allots then you want to re - think your logic.
On the other hand,you can create an array of text values such as
var textArr = new Array("first win","second win");
function open popupWin(index){
var newWin = window.open("","newWin","width=400,height=400");
//now you can write to window using the link index passed to this function
newWin.document.open();
newWin.document.write(textArr[index]);
newWin.document.close();
}
and finally in the html part you can have links like this
<a href="javascript: popupWin(0);">First Window</a>
<a href="javascript: popupWin(1);">First Window</a>
Make sure that javascript is one word it must not have space in between java and script
Hope this helps
Cheers
Khalid