javascript for pop-up box has...

User 187934 Photo


Senior Advisor
20,247 posts
Online Now

Take a look at my popup page because the colorbox example is on there with instructions.;)
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 271657 Photo


Ambassador
3,816 posts

This worked for me in FF:

http://www.webdesignlondon-tristar.co.u … LVclIb5Wup
From the example:
Finally I used the focus method which will ensure that the new window is sent to the front.


I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 127801 Photo


Registered User
55 posts

Rolly, I'm so sorry. I didn't realise you had created a page with the code for making a pop up window based on colorbox. I only just discovered it. I've put it up on a test page and it works. Thank you very much.

Could you answer one more question. How can I make my video icon the link that opens the colorbox rather than the text that I have at present. The test page is:

http://www.uk.digiserve.com/mentor/mino … x_test.htm
User 127801 Photo


Registered User
55 posts

Addition to last post. I tried using the style sheets for all five examples on the colorbox website but only the first one works properly and it is the one I have got on the test page. The other four produced two patterns. Two of them produced a full screen black pop up box with the video in the middle and the other two produced a full screen white pop up box with the video in the middle. Only the first one produces the right sized box. I really wanted to use the style in example five but I don't know why it doesn't work when I replace the existing style sheet with the one for example five.
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

Here's how to handle the image.
<a title="Pseira" href="http://www.youtube.com/embed/6KvPy0yhR5k" class="youtube cboxElement" rel="youtube"><img src="images/mycoolpic.jpg" width="100" height="100" alt=""></a>


Did you upload the images folder for colorbox?

I don't see the colorbox asign script in the head of your page.
<script>
$(document).ready(function(){
$(".youtube cboxElement").colorbox({iframe:true, innerWidth:850, innerHeight:480});
});
</script>

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

Hi,

Thanks for responding and sorry to put you to so much trouble.

I put the first three lines in the head and the rest in the footer <div> of the <body> because when I was looking at the colorbox website he said the link had to go in the <head> section. I've moved them back together now, all in the footer <div>.

I created a sub-directory in minoan called colorbox as you said, and then I extracted the zip file into that sub-directory. But the structure goes minoan-colorbox-colorbox and then in that subdirectory there's yet another colorbox plus content and examples 1-5, all in their own folders. When I click on the video icon I get a full screen version of the YouTube video opening in the same window. If I remove the
colorbox directory that I created so that the structure goes minoan-colorbox- and then the folders colorbox, contents, examples 1-5, I still get the full screen version of YouTube.

So what I did was:

In the link it says href="colorbox/colorbox.css" so having created a sub-directory of minoan called colorbox I tried putting the chosen css file there together with jquery.colorbox.js and jquery.colorbox.min.js. I deleted everything else. With the three files above, one of the examples works but if I replace it with the css from one of the other examples they don't work properly. So I obviously screwed up somewhere.

I have now reinstated everything as follows minoan-colorbox and inside that colorbox is colorobox, contents, examples 1-5 etc. But of course I'm still getting the full screen version of YouTube in the same window.


Also I've put the video icon code in and it works except for the fact that it has turned the text to the left of the icon into a link to the video as well. Here is the code

<div class="header">

<a title="Pseira" href="http://www.youtube.com/embed/6KvPy0yhR5k" class="youtube cboxElement" rel="youtube"><img src="video_icon.jpg" class="icon"</a>

<h1 class="small">TITLE GOES HERE</h1>

</div>

(end of header)
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

Your missing the > to the left of</a>.
<a title="Pseira" href="http://www.youtube.com/embed/6KvPy0yhR5k" class="youtube cboxElement" rel="youtube"><img src="video_icon.jpg" class="icon"></a>
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

Well spotted. Thanks. It's amazing what leaving out one character can do to the appearance of an html page.
User 127801 Photo


Registered User
55 posts

I've now restored everything according to your original instructions. The two pieces of code are in the body of the html for the test page and I extracted the colorbox.zip file into a folder called colorbox and uploaded the whole thing into the minoan directory on my website. Sadly, I am still getting a full-screen video in the same window when I click on the video icon.

http://www.uk.digiserve.com/mentor/mino … test01.htm
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

I just looked at your sourced code and there's no colobox links to the css or the js in the head of your page.
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

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.