2012-12-26 13 views

回答

3

哈。我一天前也有同樣的問題。我在每個斷點上重新加載網站。 ,P

我的代碼:

function responsivecheck(size){ 
    var compare = $("#wrap").width(); 
    if(size != compare){ 
     reload(); 
    } else { 
     setTimeout(
      function(){responsivecheck(compare)}, 
      5000 
     ); 
    } 
} // ! executed after rhinoslider initialization ! 

function reload() { 
    window.location.href = window.location.href; 
} 

使用in here

0
 
$(document).ready(function(){
$(window).resize(function(){
var getslidewd= $('.wrapper').width();
var getslidehi= $('.slide').height();
$('.rhino-container').width(getslidewd);
$('.rhino-container').height(getslidehi);
$('.rhino-container #slider li').width(getslidewd);
$('.rhino-container #slider li').height(getslidehi);
});
})

HTML格式

 
<div class="wrapper">
<ul id="slider">
<li><div class="slide"></div></li>
</ul>
</div>

給予修正寬度到包裝紙,固定高度上滑動和#slider。使用媒體查詢...移動和iPad,如果你想使用全屏幕滑蓋只要按照這個

$(文件)。就緒(函數(){
$(窗口).resize(函數(){
變種getslidewd = $(窗口).WIDTH();
變種getslidehi = $(窗口).height();
$( '犀牛容器。')寬度(getslidewd);
$('。rhino-container')。height(getslidehi);
$('。rhino-container #slider li').width(getslidewd);
$('。rhino-container #slider li')。height(getslidehi);
});
})

+0

請描述你提出的解決方案如何解決問題,也設法進行適當的縮進代碼以提高可讀性。 – arne

+0

給固定寬度的包裝和固定高度使用媒體查詢滑動......移動和ipad –

+0

如何使用這個新的信息更新你的答案? – arne