에 제거 : "새로운"버튼을숨기기 및 표시 div의 & I가 원하는 숨기기
클릭하면 "컨테이너"에 대한 새로운 DIV를 추가 -이 잘
를 작동
$ MOVE 버튼을 클릭하고 $ array를 취한 다음 컨테이너를 좋은 위치로 이동 한 다음 $ array에있는 각 항목에 대해 "CONTAINER"에 새 'DIV'를 추가 한 다음 'CONTAINER'를 왼쪽으로 0으로 애니메이션합니다. - 작동하지 않습니다.
"제거"버튼을 클릭하십시오 - "CONTAINE R
이 왜 web에서 작동하지 않습니다 CONTAINER ""화면 밖으로, 그리고 모든있는 div 제거 "?
HTML
<div class="panel">
<button class='new'> + </button>
<button class='move'> > </button>
<button class='remove'> < </button>
</div>
<div class="container">
</div>
CSS
.block {
margin : 0px;
width : 200px;
display : inline-block;
border-right : thin dashed #aaa;
opacity : 0;
}
.head {
margin : 0px;
padding: 5px;
height : 30px;
background-color: red;
color : white;
}
.body {
margin : 0px;
padding: 5px;
height : 190px;
background-color: #ddd;
color : black;
}
.panel {
position : absolute;
top : 50px;
padding : 5px;
color : #FFF;
font-size : 15px;
background: #d30;
height : 25px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
cursor : pointer;
}
.container {
position: absolute;
top : 90px;
left : 0px;
}
button{
width : 25px;
background : none;
cursor : pointer;
font-family : 'voltaeftu-regular',Times New Roman;
font-size : 18px;
color : #fff;
border : none;
margin : 0px;
padding : 0px;
}
jQuery를 : 당신이 겪고있는
$(".remove").click(function(){
var x_width = $('.container').find('.block').width();
var x_all = $('.container').find('.block').size();
var all_width = -10 - (x_width * x_all) ;
$(".container").animate({
left: all_width
}, 500);
});
$(".new").click(function() {
$('.container').append($('<div class="block" id="new"><div class="head">HEADER</div><div class="body">text text text</div></div>', {
css: {
display: 'inline-block',
opacity: 0
}
}).animate({ opacity: 1 }));
});
// array
var $array = [ '001', '002', '003', '004', '005' ];
$(".move").click(function(){
var array_length = $array.length;
var array_width = 0 - array_length * 200;
$('.container').css ({ left: array_width});
$.each($array , function(item, value){
$('.container').apped('<div class="block" id="'+value+'"><div class="head">HEADER '+value+'</div><div class="body">text text text</div></div>', {
css: {
display: 'inline-block',
opacity: 0
}
}).animate({ opacity: 1 });
});
$('.container').animate({ left: 0});
});
구문 오류'$ ('. 용기') apped (''apped ?? – elclanrs
예. 고맙습니다 ... 새로운 예 >>> http://jsfiddle.net/ynternet/vykV9/2/ – Patrik