I am working on my project and I am trying to do it
.
I want everything to work on a click for each image (so that each image will have its own paper), it needs to freeze, and I would like to use the dim blind effect.
I read that it would be prudent to use CSS Backgrounds for this, so I can swap photos, but I can't figure it out.
I took the code to make a div that would be clickable, but I did not make the desired effect.
jQuery(document).ready(function($) {
$('.brownbox_trigger').click(function(event) {
e.preventDefault();
var image_href = $(this).attr("href");
if ($('#brownbox').length > 0) {
$('#content').html('<img src="' + image_href + '" />');
$('#brownbox').show();
}
else {
var brownbox =
'<div id="brownbox">' +
'<p>Click to close</p>' +
'<div id="content">' +
'<img src="' + image_href + '" />' +
'</div>' +
'</div>';
$('body').append(brownbox);
}
});
$('#brownbox').live('click', function() {
$('#brownbox').hide();
});
});
EDIT: I want to use SlideDown () - SlideUp () from jQuery (), so I used some examples to make changes to my HTML code, but nothing happens when I click on the image.
JSFiddle example .
, div , jQuery .
, , , , , , ?
, , .