Advertisement
Avatarr

capture

Jan 19th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function capture() {
  3.  
  4.     var photo = document.getElementById('photo'), context = photo.getContext('2d');
  5.     photo.width = video.clientWidth;
  6.     photo.height = video.clientHeight;
  7.     context.drawImage(video, 0, 0, photo.width, photo.height);
  8.     var img = document.createElement('img');
  9.     img.src = canvas.toDataURL('image/png');
  10.     gallery.appendChild(img);
  11.     //window.open(img.src, '_blank');
  12.    
  13.  
  14. โค้ดโหลด lightbox
  15.     $(document).ready(function(){
  16.         $('.bg').animate({
  17.             "opacity":"0.9"
  18.         }, 200, "linear");
  19.         $('div#main-photo').each(function() {
  20.             var $a1 = $(this);
  21.             var src = $a1.find('img').attr('src');
  22.             //$('div.lightbox strong').text(alt).addClass('posi');
  23.             $('.bg , .lightbox').css('display','block');
  24.             $('div.lightbox img').attr('src',src).fadeIn(500);
  25.            
  26.         });
  27.                      
  28.         $('.close').click(function(){
  29.                    
  30.             close();
  31.         });
  32.     });
  33.            
  34.     function close(){
  35.                    
  36.         $('.bg , .lightbox').css('display','none');
  37.     }
  38.  
  39. -------------------------------------
  40.     onStop();
  41.     gallery.removeChild(img);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement