Skip to content

Instantly share code, notes, and snippets.

View cxytomo's full-sized avatar
🎯
Focusing

cxytomo

🎯
Focusing
View GitHub Profile
html, body, div, ul, ol, li, h1, h2, h3, h4, h5, h6, p, form,select,fieldset,textarea,input,
blockquote, th, td, img {
margin: 0;
padding: 0;
}
body {
background-color: #f1f1f1;
}
var daydetail = document.getElementsByClassName('day-detail');
var dropdown = document.getElementsByClassName('daytotal');
/*
1.daydetail[0]换成普遍方法
2.试试body上监听事件发生,只点a标签才触发
3.等等
*/
var show = function (e) {
var targ,wrap,current,status,prev_sibling,next_sibling;
e = e || window.event;
@cxytomo
cxytomo / index.html
Created October 17, 2012 13:24
index
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Clean Up Everyday!</title>
<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
<div class="header">
<a href="#" title="Clean Up Everyday!">
@cxytomo
cxytomo / dropdown.js
Created October 14, 2012 15:45
dropdown(including mouseout)
document.getElementsByClassName('open')[0].addEventListener('mouseover',function(e) {
var el,show;
e = e || window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
el = document.getElementsByClassName('open')[0];
show = el.getElementsByClassName('dropdown-menu')[0];
show.style.display = "block";
},false);
@cxytomo
cxytomo / dropdown.css
Created October 14, 2012 08:49
dropdown css(only mouseover)
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333;
}
a {
text-decoration: none;
}
@cxytomo
cxytomo / dropdown-menu.html
Created October 14, 2012 08:46
dropdown html(only mouseover)
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>dropdown-menu</title>
<link rel="stylesheet" type="text/css" href= "dropdown.css" media = "all"/>
</head>
<body>
<div class="dropdown clearfix">
<!-- Link or button to toggle dropdown -->
@cxytomo
cxytomo / dropdown.js
Created October 14, 2012 08:46
dropdown js (only mouseover)
document.getElementsByClassName('open')[0].addEventListener('mouseover',function(){
var el,show;
el = document.getElementsByClassName('open')[0];
show = el.getElementsByClassName('dropdown-menu')[0];
show.style.display = "block";
},false);
@cxytomo
cxytomo / a-hover.js
Created October 4, 2012 09:17
在a标签上加事件
var dropdown = function(e) {
e = e || window.event;
var targ = e.target || e.srcElement;
if(targ.tagName === "A" && targ.parentNode.parentNode.className === "general"){
var second = targ.parentNode.getElementsByClassName(targ.parentNode.className)[0];
var status = window.getComputedStyle(second,"").getPropertyValue('display');
if(status ==="none") {
second.style.display = "inline-block";
}
}
我是傻逼cxytomo