Wednesday, May 29, 2013

[javascript] addListener() attachEvent() onmouseover

Javascript
obj = document.getElementById('aaa')
obj.addEventListener('click',function(){alert(2)})
obj.attachEvent('onclick',function(){alert(3)})
obj.addEventListener('mouseover',f1)
function f1(){alert(5)}
                     
obj_img = document.getElementById('img1')
obj_img.addEventListener('mouseover',function(){alert(6)})
HTML
aaaaa

AAA

aaaaa
CSS
.exampleBox {
   width: 300px;
   height: 40px;
   margin: 15px 0 15px 30px;
   border: 1px solid black;
   background-color: #cccccc;
   -moz-box-shadow:inset 0 0 10px white;
   -webkit-box-shadow:inset 0 0 10px white;
   box-shadow:inset 0 0 10px white;
}
.withBackground {
  background-image: url(http://www.exratione.com/assets/color_background.png);
}
.block{
    position: relative;
}
.block .info{
    position: absolute;
    left:0px;
}
.brandimg:hover{
    opacity:0.4;
}
.withOverflowingBackground {
   position: relative; 
   background-color: transparent;
}
.withOverflowingBackground::before {
   content: " ";
   position: absolute;
   width: 500px;
   height: 40px;
   z-index: -1;
   background-image: url(http://www.exratione.com/assets/color_background.png);
}

No comments: