var seconds = new Date().getTime() / 1000;
<input type="text" value="3" class="field left" readonly>
.content {
width: 100%;
box-sizing: border-box;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
#demo
{
background:url(bg_apple_little.gif) no-repeat center center;
height:200px;
width:200px;
}
function css(a) {
var sheets = document.styleSheets, o = {};
for (var i in sheets) {
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (a.is(rules[r].selectorText)) {
o = $.extend(o, css2json(rules[r].style), css2json(a.attr('style')));
}
}
tr:nth-child(even) { background-color: #000000; }
以上方法不适用于IE8及以下版本。
也可用通过jQuery的方法实现:
$(document).ready(function() {
$("tr:even").css("background-color", "#000000");
});
简单的tooltip:
<div title="This is my tooltip">
复杂的tooltip参考:http://www.designer-daily.com/jquery-prototype-mootool-tooltips-12632
function css(a) {
var sheets = document.styleSheets, o = {};
for (var i in sheets) {
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (a.is(rules[r].selectorText)) {
o = $.extend(o, css2json(rules[r].style), css2json(a.attr('style')));
}
}
热门内容
最新内容
- 1 week 5 days ago
- 2 weeks ago
- 3 weeks 2 days ago
- 3 weeks 3 days ago
- 3 weeks 4 days ago
- 1 month ago
- 1 month ago
- 1 month ago
- 1 month 1 week ago
- 1 month 1 week ago
最新评论