Need help with my lightbox code
I'm doing a simple lightbox but I cannot get the lightbox to pop up when I click on the thumbnail. Any help would be appreciated.
- $(document).ready(function() {
- set_up_lightbox();
- });
- function set_up_lightbox() {
-
- $("body").append($("<div/>").attr("id","lightbox_overlay"));
-
- $("body").append($("<div/>").attr("id","lightbox_container"));
-
-
-
- $("#lightbox_overlay").hide();
-
- $("#lightbox_container").hide();
-
-
- $("#gallery").append( $("<img/>").attr("src", "flowers_thumb.jpg"));
- $("#gallery").click( function() {load_image("flowers.jpg"); });
- }
- var load_image = function(url) {
-
- $("#lightbox_container").empty();
-
- $("lightbox_overlay").fadeIn("slow");
-
- $("#lightbox_container").append( $("<img/>").attr("src", "flowers.jpg"));
-
- $("lightbox_container").click(function() { close_image(); });
-
- $("lightbox_container").fadeIn("slow");
- }
- function close_image() {
-
- $("#lightbox_container").hide();
-
- $("#lightbox_overlay").hide();
- }