Skip to content

Instantly share code, notes, and snippets.

@adelcambre
Created August 27, 2008 20:13
Show Gist options
  • Save adelcambre/7571 to your computer and use it in GitHub Desktop.
Save adelcambre/7571 to your computer and use it in GitHub Desktop.
$(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