View Full Version : Display div when lightwindow closed?

08-29-2010, 01:13 AM
I'm not great with javascript and I'd appreciate any help or guidance. I'm using jquery colorbox to open a window when the page loads. However there is also a video player that automatically plays at the same time (flash). I'm trying to figure out how to modify the colorbox code so that the containing div for the video is initially hidden from view until the colorbox window is closed.

The function to initialize it is:

$(document).ready(function() {
$.fn.colorbox({href:"#inline_example1", width:"33%", inline:true, open:true});

Which I thought is where code should go to initially hide the div? Then I'm not sure but inside the actual colorbox code there is a function for closing the window. Is there a way to attach an event to that closing function that will change the hidden div to being visible?

$overlay.click(function () {
if (settings.overlayClose) {

08-29-2010, 06:00 AM
So it turned out to be really simple, even for me. In the first function I put
$("#videocontainer").hide(); to hide it when the page loads, and in the second function I put
$("#videocontainer").show(); to show it when the box is closed.