jQuery08 元件選取(html元素+CSS ID)+元件淡入淡出效果顯示+console.log()除錯

jQuery08 元件選取(html元素+CSS ID)+元件淡入淡出效果顯示+console.log()除錯

jQuery08 元件選取(html元素+CSS ID)+元件淡入淡出效果顯示+console.log()除錯

 

資料來源http://www.w3school.com.cn/jquery/index.asp

code2html:http://tohtml.com/

 

<!DOCTYPE html>
<html>
<head>
<title>jQuery 元件選取(html元素+CSS ID)+元件淡入淡出效果顯示+console.log()除錯</title>
<!--資料來源	http://www.w3school.com.cn/jquery/index.asp-->
<scriptsrc="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
/*HTML+class作為選擇器*/
$("button.fadeIn01").click(function(){
console.log("fadeIn01");
$("#div1").fadeIn();
$("#div2").fadeIn("slow");
$("#div3").fadeIn(3000);
});
///*
$("button.fadeOut01").click(function(){
console.log("fadeOut01");
$("#div1").fadeOut();
$("#div2").fadeOut("slow");
$("#div3").fadeOut(3000);
});
$("button.fadeToggle01").click(function(){
console.log("fadeToggle01");
$("#div1").fadeToggle();
$("#div2").fadeToggle("slow");
$("#div3").fadeToggle(3000);
});
//*/							
});
</script>
</head>
<body>
<buttontype="button"class="fadeIn01">fadeIn()-淡入</button>
<buttontype="button"class="fadeOut01">fadeOut()-淡出</button>
<buttontype="button"class="fadeToggle01">fadeToggle()-相反</button>
<divid="div1"style="width:80px;height:80px;display:none;background-color:red;"></div>
<br>
<divid="div2"style="width:80px;height:80px;display:none;background-color:green;"></div>
<br>
<divid="div3"style="width:80px;height:80px;display:none;background-color:blue;"></div>
</body>
</html>



 

 


發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *