![](/img/trans.png)
[英]jQuery/Javascript - Fade in div onclick fade out another doesn't work
[英]jQuery or onClick Div Fade
如果這是在錯誤的部分,我深表歉意..
有人可能會指出我關於此的腳本或教程:
當我點擊某物時,例如“x”,我會點擊它,然后它會在點擊時消失。
如果你明白我的意思,有人能指出我正確的方向嗎?
謝謝!
$('someclass/id').click(function() {
$('someclass/id').fadeOut();
});
$('a').toggle(
function() { $('#us').fadeIn(); },
function() { $('#us').fadeOut(); }
);
show( effect, [options], [speed], [callback] ) jQuery UI
參考這個: http : //www.webdesignerwall.com/demo/jquery/
有針對不同 UI 元素的小教程,有很好的解釋。
很容易你可以用谷歌搜索。
jQuery('#divId').click(function(){
jQuery(this).hide('slow'); //this will give a little animated effect.
// or
jQUery(this).fadeOut('slow');
});
http://api.jquery.com/fadeOut/ http://api.jquery.com/hide/
這描述了如何在單擊時淡入和淡出元素
$(document).ready(function(){
$("#elemntID").click(function() {
$("#ID_of_element_need_to_fade_in").fadeIn("slow");
});
$("#elemntID").click(function() {
$("#ID_of_element_need_to_fade_out").fadeOut("slow");
});
});
用
$('#id').click(function() {
$('#id').fadeIn();
$('#id').fadeOut();
});
[link][1]
<script>
$("button:first").click(function() {
$("p:first").fadeToggle("slow", "linear");
});
$("button:last").click(function () {
$("p:last").fadeToggle("fast", function () {
$("#log").append("<div>finished</div>");
});
});
</script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.