Guest User

Untitled

a guest
Dec 9th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. //lightbox
  2. $(".lightbox").live("click", function(event){
  3. event.preventDefault();
  4. var href=$(this).attr('href');
  5. $('body').append('<div class="overlay"></div>');
  6. var img = $('<img />').load(function () {
  7. $(".overlay").append(img);
  8. }).error(function() {
  9. $('.overlay').append('<p class="error">no big version</p>');
  10. }).attr('src', href);
  11.  
  12.  
  13.  
  14. })
  15. $(".overlay").live("click", function(event){
  16. $(this).animate({'opacity':'0'}, 300, 'linear', function(){
  17. $(this).remove();})
  18. })
Add Comment
Please, Sign In to add comment