Created
August 27, 2008 20:13
-
-
Save adelcambre/7571 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$(".photo").each(function(i, e) { | |
$zoom_id = i + '_zoom'; | |
$show_link = $('<a class="jquery_link">Toggle Photo</a>'); | |
$show_link.click(function () { $(this).siblings('img').toggle() }); | |
$(this).append($show_link); | |
if (($original = $(this).find(".original")).size() > 0) { | |
$zoom_link = $('<a class="jquery_link">Zoom</a>'); | |
$zoom_div = $('<div class="zoom"><img class="dialog_img" src="' + $original.attr("href") + '"/></div>'); | |
$zoom_div.hide(); | |
$(this).append($zoom_div); | |
$(this).append($zoom_link); | |
$zoom_link.click(function() { $(this).siblings("div.zoom").show(); $(this).siblings("div.zoom").dialog({ | |
modal: true, | |
overlay: { | |
opacity: 0.5, | |
background: "black" | |
}, | |
dragable: false, | |
resizable: false, | |
height: "90%", | |
width: "90%" | |
}); console.log($zoom_div)}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment