Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function showPost(id){
  2.          
  3.           if(id){
  4.              
  5.                 $("#wrap_"+id+".imgpopup").fadeIn("slow");
  6.                  $("#wrap_"+id+".imgpopup").css('top',window.pageYOffset);
  7.              
  8.                  marginTop = $(window).height()-$('#img_'+id).height();
  9.                
  10.                  console.log(marginTop);
  11.                 $('#img_'+id).toggle( "clip" );
  12.               $('#img_'+id).css('display','inline-block');
  13.               $('#img_'+id).css('top',window.pageYOffset+marginTop/2);
  14.             document.onmousewheel = function(e){ e.preventDefault(); }
  15.              document.ontouchmove = function(e){ e.preventDefault(); }
  16.           }
  17.    
  18.          
  19.          
  20.       }
  21.      
  22.       function showLargeImg(id){
  23.                marginTop = $(window).height()-$("#full_"+id+".FullImage:hidden").height();
  24.            
  25.              
  26.            
  27.               $("#full_"+id+".FullImage:hidden").css('top',window.pageYOffset+marginTop/2);
  28.                 $("#full_"+id+".FullImage").css('overflow','hidden');
  29.              $( "#full_"+id+".FullImage:hidden" ).fadeIn( "slow" );
  30.                 imgMargin = $(window).width()/2 - $("#full_"+id+" img").width()/2;
  31.                 imgTop = $(window).height()/2 - $("#full_"+id+" img").height()/2;
  32.               $("#full_"+id+" img").css('margin-left',imgMargin+'px');
  33.                $("#full_"+id+" img").css('margin-top',imgTop+'px');
  34.            
  35.          
  36.       }
  37.      
  38.       function hideLargeImg(id){
  39.          
  40.            
  41.                $( "#full_"+id+".FullImage" ).fadeOut( "slow" );
  42.                
  43.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement