javascript for pop-up box has...

User 127801 Photo


Registered User
55 posts

I got the following script for creating pop up boxes from the Internet -- the guy was offering it free, I didn't steal it. I am having two problems with it and I wondered if anyone could help.

His javascript

<script type="text/JavaScript">

function popjack()
{ window.open('misc/poppy2.html','popjack','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=480,height=480');
}

</script>

<a href="nojavascript... popjack()" onMouseOver="window.status='Status Bar Message';
return true" onMouseOut="window.status=''; return true">
Click Me<a>

To this I have added in the a href section title="Click here to see site plan" and the img tag in place of the words click me as I wanted the link to be an icon rather than words.

I have also put the part within the script tags in the head section and the a href part in the appropriate place in the body of the html. This doesn't seem to make any difference as I still have the problems if I unite the stuff in the script tags with the code in the body of the html page.

The first problem is that the </a> tag that closes the a href at the end turns from green to blue in Coffeecup and all the writing afterwards comes out green. Although the javascript works and the text looks normal in my browser, there is presumably something wrong with the code as the colours are wrong. Here is the version I am using.

<script type="text/JavaScript">

function planbox()
{ window.open('phaistos_plan.htm','planbox','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=1300,height=1000');
}

</script>


<a href="nojavascript... planbox()" title="Click here to see site plan" onMouseOver="window.status='Status Bar Message';
return true" onMouseOut="window.status=''; return true"> <img src="plan.gif" class="icon" border="0" class="link"> </a>

Then Whatever I type next comes out green in Coffeecup.

Any ideas what is wrong with the code I am using and how to get the effect I want with correct code?


The second problem is more serious. It only happens in Firefox fortunately but I'd rather it didn't happen at all. I am using the same code to open a pop up box in which a Youtube video is embedded. The pop up box opens when you click on the icon, but as soon as the embedded video appears, the pop-up box minimises to the task bar. If I close it and then open another video pop up box it doesn't minimise. Only the first one to open minimises. But visitors to my website will probably wonder where it went! Any ideas why this is happening and how I can stop it.

Here is the code I am using for the video pop up box. Again I have put the script in the head and the ahref in the body but putting them together in the body doesn't solve the problem. Any ideas why the pop up box is minimising?

Thanks

Ian Swindale


<script type="text/JavaScript">

function videobox()
{
window.open('pseira_video.htm','videobox','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=900,height=500');
}

</script>

<a href="nojavascript... videobox()" title="Click here to see video clip" onMouseOver="window.status='Status Bar Message';
return true" onMouseOut="window.status=''; return true"> <img src="video_icon.jpg" class="icon" border="0"> </a>
User 127801 Photo


Registered User
55 posts

Correction to my first post.

The pop up box doesn't minimise it disappears behind the browser. If you minimise the browser the pop up box is there. What I need to do is make it stay on top.

Here is the link to a page on my website with two icons for pop up boxes. One is for the video pop up box which disappears and the other is for a .jpg file which doesn't disappear. This is for Firefox only.

http://www.uk.digiserve.com/mentor/minoan/pseira.htm
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

I would try this.:)
http://www.w3schools.com/js/js_popup.asp
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 127801 Photo


Registered User
55 posts

Thanks. I took a look but it doesn't include pop up boxes that contain things like extra information that you do not want to put in the main page.
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

You can put anything in the popup boxes.:)
http://progrower.coffeecup.com/popup.html
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 127801 Photo


Registered User
55 posts

Thanks for providing such an economical code. Unfortunately it still produces the same problem in Firefox when I use it to open a pop up window with an embedded YouTube video. As soon as the video starts to launch the pop up window disappears behind the browser. I really need to find a way to stop that happening.
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

Try the new example I just put up.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 127801 Photo


Registered User
55 posts

I did. The pop up box still disappears behind the browser in Firefox. I think it's because it's got an iframe tag on the page that opens in the pop up box. I don't have the same problem when the pop up box contains only text or only an image.
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

It must be a local problem because it stays in front for me in FX. I just did a colorbox example that I think looks even better then using java script popup.:cool:
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 127801 Photo


Registered User
55 posts

Yes, my brother reported the same. It is clearly a local problem. I tried turning off any add-ons that might affect the pop up window but it didn't make any difference. It's annoying though because of course I use my FX to test the web pages I upload and yet I get different results from everyone else.

While searching for a solution on the Internet I came across colorbox and I bookmarked the page because as you say it would probably look better. The problem for me is that I have a very simple web page -- very basic CSS, almost no javascript, which consequently I do not understand, and so basically when I need javascript I have to go to a site that offers the code. It hasn't seemed worthwhile to learn all about javascript when I can get the very basic code I need so easily. So while I'll take a look at the colorbox webpage I won't be using it if it involves learning a load of stuff that I'll forget in a couple of months because my use of javascript is so limited.

Anyway, thanks for persevering with my problem.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.