Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2007
    Posts
    157
    Thanks
    6
    Thanked 4 Times in 4 Posts

    Display div when lightwindow closed?

    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:
    Code:
    $(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?

    Code:
    $overlay.click(function () {
    			if (settings.overlayClose) {
    				publicMethod.close();
    			}
    		});

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    157
    Thanks
    6
    Thanked 4 Times in 4 Posts
    So it turned out to be really simple, even for me. In the first function I put
    Code:
    $("#videocontainer").hide();
    to hide it when the page loads, and in the second function I put
    Code:
    $("#videocontainer").show();
    to show it when the box is closed.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •