在此先感謝,我試圖添加粘滯圖像一個在另一個之後,如下圖所示,但我得到的結果作爲一個在另一個下。最新增加的便籤應該在最前面,所有其他便籤都將落後最新。任何幫助將被理解。添加一個在另一個粘滯便箋
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style>
.pink{
\t background:#f05f9d;
\t border:1px solid #f05f9d;
\t color:#fff;
\t font-weight:600;
}
.pink:hover{
\t background:#f05f9d;
\t border:1px solid #f05f9d;
\t color:#fff;
\t font-weight:600;
}
.pink-button{
\t padding: 10px 11px;
\t border-radius: 14px;
\t font-weight: 600;
\t font-size: 16px;
}
.sticky {
\t margin: 0;
\t padding: 8px 24px;
\t width:200px;
\t height:200px;
\t font-size: 1.4em;
\t border:1px #E8Ds47 solid;
\t -moz-box-shadow:0px 0px 6px 1px #333333;
\t -webkit-box-shadow:0px 0px 6px 1px #333333;
\t box-shadow:0px 0px 6px 1px #333333;
\t background: #fefdca;
\t background: -moz-linear-gradient(top, #fefdca 0%, #f7f381 100%);
\t background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefdca), color-stop(100%,#f7f381));
\t background: -webkit-linear-gradient(top, #fefdca 0%,#f7f381 100%);
\t background: -o-linear-gradient(top, #fefdca 0%,#f7f381 100%);
\t background: -ms-linear-gradient(top, #fefdca 0%,#f7f381 100%);
\t filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefdca', endColorstr='#f7f381',GradientType=0);
\t background: linear-gradient(top, #fefdca 0%,#f7f381 100%);
}
.sticky p {
\t text-align: center;
}
.sticky textarea {
\t width:160px;
\t height:170px;
\t background: #fefdca;
\t background: -moz-linear-gradient(top, #fefdca 0%, #f7f381 100%);
\t background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fefdca), color-stop(100%,#f7f381));
\t background: -webkit-linear-gradient(top, #fefdca 0%,#f7f381 100%);
\t background: -o-linear-gradient(top, #fefdca 0%,#f7f381 100%);
\t background: -ms-linear-gradient(top, #fefdca 0%,#f7f381 100%);
\t filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefdca', endColorstr='#f7f381',GradientType=0);
\t background: linear-gradient(top, #fefdca 0%,#f7f381 100%);
\t border-bottom:none !important;
}
.sticky ol {
\t margin: 12px;
}
</style>
</head>
<body>
<div class="sticky">
<textarea placeholder="Type the problem here..."></textarea> \t \t \t \t
</div><br/> \t \t
<div id="spin_btn_div">
<div class="btn-container" style="margin-bottom:0px;position:absolute;margin-left:40px;">
<a class="btn pink pink-button shooter-btn" id="addProblem">Add problem</a>
\t </div>
</div>
</body>
<script>
$('#addProblem').click(function(){
\t $('.sticky').after('<div class="sticky"><textarea placeholder="Type the problem here..."></textarea><br></div>');
});
</script>
</html>
嘗試將'.sticky'設置爲'position:absolute;'然後在他們的父對象上設置'position:relative;',然後使用它們的'z-index'和'left/right'屬性。 – Krusader
試試這個https://jsfiddle.net/x7cqphq9/ – Krusader
嗯,完美...,但它是像一個在另一個上面添加,我想像一個在另一個像在上面的圖像... ...! –