簡體   English   中英

使用縮放和浮動div調整大小

[英]Resize with zoom and floating div

我有一個環繞div,其中包含一個帶有jCarousel的div,並且在div附近,有兩個箭頭用於更改圖片。

問題是當我調整瀏覽器大小或放大或縮小時,箭頭會移動並在jcarousel div上方和下方移動。

為什么會這樣發生? 這是一個示例: http : //fiddle.jshell.net/Wbt83/

我無法模擬您遇到的麻煩,但這是響應式設計的正確flow

您項目的pseudo CSS:

.wrapper{
    position: relative;
    width: 100%;   // Your custom width here
    height: 300px; // Custom height
}

.wrapper .jcarousell{
    [...] // jCarousell specif css
}

.wrapper .arrow{
    position: absolute;
    top: 40%;     // Custom top spacing for arrows
    height: 20px; // Arrow height
    width: 20px;  // Arrow width
}

.wrapper .arrow-left{
    left: 0;
}

.wrapper .arrow-right{
    right: 0;
}

您項目的偽HTML

<div class="wrapper">
    <ul class="jcarousell">
        <li>[...]</li>
        <li>[...]</li>
        <li>[...]</li>
    </ul>

    <img class="arrow arrow-left" src="leftArrow.png"/>
    <img class="arrow arrow-right" src="rightArrow.png"/>
</div>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM