javascript 标题//来源https://jsbin.com/divuraj

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 标题//来源https://jsbin.com/divuraj相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Bubbling (propagation of the event across the DOM) </title>
<style id="jsbin-css">

</style>
</head>
<body>
<div id = "big" class = "red">
    <div id = "medium" class = "green">
        <div id = "small" class = "blue">

        </div>
    </div>
</div>
</body>
</html>
.red {
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: red;
}

.green {
    position: absolute;
    left: 200px;
    width: 160px;
    height: 160px;
    background-color: green;
}

.blue {
    position: absolute;
    top: 200px;
    width: 100px;
    height: 100px;
    background-color: blue;
}

.y{background-color: yellow;}

.border-pink {border: 10px solid pink;}
.border-brown {border: 10px solid brown;}
big.addEventListener("click", function(e){
  
  big.classList.toggle("y");
  
})

medium.addEventListener("click", function(e){
  e.stopPropagation();
  medium.classList.toggle("border-brown");
})

small.addEventListener("click", function(e){
  e.stopPropagation();
  small.classList.toggle("border-pink");
})

以上是关于javascript 标题//来源https://jsbin.com/divuraj的主要内容,如果未能解决你的问题,请参考以下文章

chrome 上的 javascript 错误 :: 阻止了来源为“https://tpc.googlesyndication.com”的框架 [重复]

javascript //来源https://jsbin.com

javascript JS Bin //来源https://jsbin.com/kanukob

html javascript在.Rmd中呈现推文。资料来源:https://dev.twitter.com/web/javascript/loading

Yammer JavaScript SDK -“访问控制允许来源”问题

JavaScript 跨域调用:从 HTTP 调用到 HTTPS