이미지를 클릭 할 때 jQuery를 사용하여 div에서 페이드 아웃하고 이미지를 다시 클릭하면 숨길 수 있습니다.클릭시 페이드 인과 페이드 아웃 사이를 전환
어떻게하면됩니까?
기본적으로 토글 스위치가 필요합니다.
이미지를 클릭 할 때 jQuery를 사용하여 div에서 페이드 아웃하고 이미지를 다시 클릭하면 숨길 수 있습니다.클릭시 페이드 인과 페이드 아웃 사이를 전환
어떻게하면됩니까?
기본적으로 토글 스위치가 필요합니다.
$('#my_img_selector').click(function(){$('#my_div_selector').fadeToggle()});
slideToggle()
및 toggle()
도 fadeToggle()
대신 사용하십시오.
마크 업에 따라 $('#fadeMe')
및 $('#bindImage')
의 선택기를 변경해야합니다. 마법 BTW here
$(document).ready(function(){
$('#bindImage').on('click', function(){
$('#fadeMe').fadeToggle();
//return false; // only useful if you trigger an <a href="#"></a>
});
});
$('#yourimage').on('click', function(event){
if ($("#something").is(':visible')) {
$(".something").hide("drop", {
direction: "up"
}, 2000);
}else{
$(".something").show("drop", {
direction: "up"
}, 2000);
}
});
JQuery와 UI의 경우이 드롭입니다 – jycr753