반응형
jquery 프리펜드+페이드인
코드는 다음과 같습니다.
$.ajax({
url : url,
data : {ids : JSON.stringify(jsonids), hotel_id: hotel_id},
success : function(response)
{
$('#be-images ul').prepend(response).fadeIn('slow');
},
dataType: 'html'
});
페이드인은 작동하지 않습니다...나는 그 콘텐츠를 앞에 붙이고 희미하게 하고 싶다...어떻게 해야 되지?
잘 부탁드립니다!
가정하다response
HTML 이므로 다음을 시도해 보십시오.
$(response).hide().prependTo("#be-images ul").fadeIn("slow");
이렇게 하면:
$('#be-images ul').prepend(response).fadeIn('slow');
실제로 페이드 되고 있는 것은, 초기 셀렉터(앞의 리스트)의 결과이며, 이미 표시되어 있습니다.
+1에서 cletus까지입니다만, 다른 방법을 강조하고 싶습니다.
$('#be-images ul').prepend(
$(response).hide().fadeIn('slow')
);
시험해 보세요: HTML
<button>Add</button>
<div id="data"></div>
쿼리:
$('button').click(function() {
$('#data').prepend('<div class="item">Test</div>'"');
$("#data .item:first-child").hide();
$("#data .item:first-child").fadeIn();
});
라이브 데모: jsfiddle
언급URL : https://stackoverflow.com/questions/1906066/jquery-prepend-fadein
반응형
'programing' 카테고리의 다른 글
Oracle DB: 대소문자를 무시한 쿼리를 작성하려면 어떻게 해야 합니까? (0) | 2023.03.13 |
---|---|
문자열의 JSON 배열을 어떻게 나타냅니까? (0) | 2023.03.13 |
Woocommerce 3의 가변 제품 드롭다운에서 "옵션 선택"을 제거합니다. (0) | 2023.03.13 |
NoSQL - MongoDB vs CouchDB (0) | 2023.03.13 |
두 개의 "선택"이 동일한지 확인합니다. (0) | 2023.03.13 |