-
- $("#content").click(function (e) {
- //$(this).height(200); //第一次,直接改变高度
- $(this).animate({ "height": 200 }, 2000, function () {
- console.log("end");
- }).stop(true, true);//第二次,缓慢改变高度
- //e.preventDefault();
- console.log("content 冒泡1");
- });
- $("#content").click(function (e) {
- console.log('content 冒泡2', $(this).height());
- });
- $("#content").on("click", function () {
- console.log('content 冒泡3', $(this).height());
- });
- $("#content")[0].addEventListener("click", function (e) {
- console.log('content 捕获1', $(this).height());
- }, true);
- $("#content")[0].addEventListener("click", function () {
- console.log('content 捕获2', $(this).height());
- }, true);
- $("#box").click(function () {
- console.log('box 冒泡1', $("#content").height());
- });
- $("#box").on("click", function () {
- console.log('box 冒泡2', $("#content").height());
- });
- $("#box")[0].addEventListener("click", function (e) {
- console.log('box 捕获1', $("#content").height());
- e.stopPropagation();
- }, true);
- $("#box")[0].addEventListener("click", function (e) {
- console.log('box 捕获2', $("#content").height());
- //e.stopPropagation();
- }, true);
- $("#box").on("scroll", function () {
- console.log("resize");
- });