2011-09-30 22 views
0

ライトボックスは右上(上/左中央)に表示されますが、ユーザーがズームすると表示されます。 lightobxは、あなたが私をライトボックスのコードをチェックしていますヘッダライトボックスは、ウィンドウ内で表示されなくなり、Androidではサイズが変更されます

の青いボタンでtest this hereクリックをすることができます

、同じ位置(ウィンドウ/ビューがサイズ変更された考慮せずに/クロップ)に留まり、そして

function(w, h) { 
     var size = { x: $(window).width(),  y: $(window).height() }; 
     var scroll = { x: $(window).scrollLeft(), y: $(window).scrollTop() }; 
     var height = h!=null ? h : this.esqueleto.lightbox.outerHeight(); 
     var width = w!=null ? w : this.esqueleto.lightbox.outerWidth(); 
     var y  = 0; 
     var x  = 0; 

     //vertically center 
     x = scroll.x + ((size.x - width)/2); 

     if (this.visible) { 
      y = scroll.y + (size.y - height)/2; 
     } else if (this.options.emergefrom == "bottom") { 
      y = (scroll.y + size.y + 14); 
     } else {// top 
      y = (scroll.y - height) - 14; 
     } 

     if (this.visible) { 

      if (!this.animations.move) { 
      this.morph(this.esqueleto.move, { 
       'left' : x 
      }, 'move'); 
      } 

      this.morph(this.esqueleto.move, { 
      'top' : y 
      }, 'move'); 

     } else { 

      this.esqueleto.move.css({ 
      'left' : x, 
      'top' : y 
      }); 
     } 
     } 

質問です:どのように私はきちんと新しい高さを計算し、これを使用して新しいことができMOVEBOXが()されている場合、私は

$(window).bind('resize', $.proxy(function() { 
      if (this.visible) 
      { 
      this.overlay.resize(); 
      if (!this.maximized) { 
       this.movebox(); 
      } 
      } 
     }, this)); 

を見ることができますライトボックスはsrcollに続き、アンドロイドでズームします(また、iphoneでは少し動いています)。

答えて

関連する問題