-
Pop up window again....
I have another question about the pop up window I made a while ago... I need to specify the width and the height of the window that is made....
I was wondering if it is meant to go in the code like this:
onClick="javascript:window.open('text/oneday.txt',menubar='no',status='no',toolbar='no',width="400",height="600")";
-
that should work!
taken from another site:
Code:
remote=window.open("http://www.enteract.com/~rhillego/courses/create_remote.html","remotewindow","width=100,height=250");
-
What happens is that it resizes the button image to that size for some stupid reason!! :) Oh well I will work it out... :)
-
the onclick should go in the button but the width and height should go into the javascript function
-
Try moving the code to a JavaScript function and just call the function in the ONCLICK event:
Code:
function openWin(){
window.open('yourpage.html','newWin',menubar='no',status='no',toolbar='no',height=300,width=300);
}
<input TYPE = "button" VALUE = "Open" ONCLICK = "openWin();">
Chris
-
i think the problem lies in your "" marks
you have this:
Code:
onClick="java script:window.open('text/oneday.txt',menubar='no',status='no',toolbar='no',width="400",height="600")";
try this
Code:
onClick="java script:window.open('text/oneday.txt',menubar='no',status='no',toolbar='no',width='400',height='600')";
-
That's not necessarily true. I had the same problem. The only fix was to put the code in a function and call the function in the ONCLICK event. More strange browser behavior.
-
I will try changing the quote maks today.. Unfortunately I don't have time to change this before this meeting they are having so the changes will have to be made after the meeting is over.... :)
-
I saw an example of the way you are doing it, try this.
Code:
<INPUT TYPE="button" VALUE="Open window2" onClick="msgWindow=window.open('text/oneday.txt','window2','menubar=no,status=no,toolbar=no,width=400,height=600')">
notice ther is only one set of ''
-
I will try doing both to this problem today as I now have my computer back from the meeting. :)
-
Nope it still doesn't work.... This is bugging me now... Though I have vhanged it slightly... I am now calling an ASP file into the new window which helps slighlty because it auto formats the words... The window is still to big.... This is really strange.
-
can you post the code Chris? jus thte part that opens the window??
-
I don't know if this is what you are trying but it works
Code:
<form>
<input type=button value="http://www.vbforums.com"
onClick="msgWindow=window.open('http://www.vbforums.com','','menubar=yes,status=yes,toolbar=yes, resizable=yes,scrollbars=yes,width=640,height=480')">
</form>
-
Cheers scoutt, that last one worked like a treat.. :) Thanks again!!!! :)
-
well it's about time. :D
I was playing around with another post and came acrossed it and said to myself, "self, you might have what chris is looking for" :D and tada,, cool glad it worked.
-
Cool... Well cheers again Scoutt... It really helped. Its a shame that my HTML problem is still there! :(