Need to control popup size from menu button
Need to control popup size from menu button
OK, I have my buttons working well now thanks to mikeyb but have one more problem...
Before I was using the drop down menu created with this software, I had a text link to a webpage to play a youtube video. The video object is a fixed dimension and I had used javascript to popup the page with the same dimensions so that, basically, the link opened a window with no toolbars, etc and was the exact size of the video, in the middle of the screen.
I tried to copy the same javascript into the <a href link that appears in the code for the drop down menu but it doesn't work.
Basically, how can a drop down button open a popup of fixed dimension?
Thanks
Mike
Before I was using the drop down menu created with this software, I had a text link to a webpage to play a youtube video. The video object is a fixed dimension and I had used javascript to popup the page with the same dimensions so that, basically, the link opened a window with no toolbars, etc and was the exact size of the video, in the middle of the screen.
I tried to copy the same javascript into the <a href link that appears in the code for the drop down menu but it doesn't work.
Basically, how can a drop down button open a popup of fixed dimension?
Thanks
Mike
Re: Need to control popup size from menu button
What code have you tried to put in the href?
I would put the JavaScript code in a function in your <head> section:
and then the href would be:
I would put the JavaScript code in a function in your <head> section:
Code: Select all
<head>
... you existing head stuff ...
<script type="text/javascript">
function YourFunction() {
code to do your popup;
}
</script>
</head>
Code: Select all
<a href="javascript:YourFunction()">Link text</a>
Re: Need to control popup size from menu button
I have been using a pop up generator from this website:
http://javascript.internet.com/generato ... indow.html
Here is the script code I was using, but I have to admit, I do not know javascript. I barely know html!!
Way back when I used to do a lot more site design and did a fair amount of Flash and actionscript but that's been a long time...
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=560,height=340,left = 360,top = 230');");
}
and for the href...
<A HREF="javascript:popUp('http://www.onotsky.net/faceoflovevideo.html')">Open the Popup Window</A>
I appreciate any help you can be. At the end of the day, I just want the link to bring up a page with a fixed size of 560x340 with no resize, sccroll, toolbars, etc and also be centered.
Thanks a ton!
http://javascript.internet.com/generato ... indow.html
Here is the script code I was using, but I have to admit, I do not know javascript. I barely know html!!

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=560,height=340,left = 360,top = 230');");
}
and for the href...
<A HREF="javascript:popUp('http://www.onotsky.net/faceoflovevideo.html')">Open the Popup Window</A>
I appreciate any help you can be. At the end of the day, I just want the link to bring up a page with a fixed size of 560x340 with no resize, sccroll, toolbars, etc and also be centered.
Thanks a ton!
Re: Need to control popup size from menu button
Well that code works fine on a test HTML page, but if it works with the menu maker code I couldn't say as I don't have the software.
So nothing wrong with that code you posted on it's own, it's if they both work together.
Do you get any error messages when used from your menu?
Can you post a link to your page with it on?
Mike
So nothing wrong with that code you posted on it's own, it's if they both work together.
Do you get any error messages when used from your menu?
Can you post a link to your page with it on?
Mike
- Karlis
- Site Admin
- Posts: 3605
- Joined: Mon Jul 15, 2002 5:24 pm
- Location: Riga, Latvia, Europe
- Contact:
Re: Need to control popup size from menu button
Make sure the code copied in href is formatted correctly. E.g. It must begin with javascript:
Probably you should isolate the code into a function and use something like this href="javascript:DoMyCode();"
Probably you should isolate the code into a function and use something like this href="javascript:DoMyCode();"
Re: Need to control popup size from menu button
Thanks for the help guys...still not working though. Check out this link:
http://www.onotsky.net/multimediatest.html
Click on the video button, then Uganda (Face of Love)...
http://www.onotsky.net/multimediatest.html
Click on the video button, then Uganda (Face of Love)...
- Karlis
- Site Admin
- Posts: 3605
- Joined: Mon Jul 15, 2002 5:24 pm
- Location: Riga, Latvia, Europe
- Contact:
Re: Need to control popup size from menu button
First, you have double = signs in your code (href=="). It is wrong, there should be only one = sign.
Re: Need to control popup size from menu button
Sorry, that was a new error when I edited the code this time but it still will not work even after I deleted one of the equals signs.
Re: Need to control popup size from menu button
Hi,
There seems to be something "odd" going on with Firefox 3.5.5, it's not running the JavaScript function at all, and simply going to the faceoflovevideo page like a normal link. As soon as you take the link out of the JavaScript call it then will call the function.
Never had this problem before with Firefox, could be a bug with latest versions?
Works fine for me in IE so to me it looks like just a problem with Firefox.
Anyway, this code works for me on a simple test page in both Firefox & IE:
There seems to be something "odd" going on with Firefox 3.5.5, it's not running the JavaScript function at all, and simply going to the faceoflovevideo page like a normal link. As soon as you take the link out of the JavaScript call it then will call the function.
Never had this problem before with Firefox, could be a bug with latest versions?
Works fine for me in IE so to me it looks like just a problem with Firefox.
Anyway, this code works for me on a simple test page in both Firefox & IE:
Code: Select all
<a href="#" onclick="popUp('http://www.onotsky.net/faceoflovevideo.html')" title="">Uganda (Face of Love)</a>
Re: Need to control popup size from menu button
Awesome! That works...thanks a ton!!
-
- Posts: 1
- Joined: Tue Jan 19, 2010 1:30 pm
Re: Need to control popup size from menu button
MikeyB wrote:What code have you tried to put in the href?
I would put the JavaScript code in a function in your <head> section:
and then the href would be:Code: Select all
<head> ... you existing head stuff ... <script type="text/javascript"> function YourFunction() { code to do your popup; } </script> </head>
Code: Select all
<a href="javascript:YourFunction()">Link text</a>
Thanks for this. Well done.