Commit d92024a6 authored by 夏彬's avatar 夏彬

Merge remote-tracking branch 'origin/test' into test

parents 2f01209d dd758fca
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
background-color: #f3f3f3; background-color: #f3f3f3;
} }
.related-news .rl-tit { .related-news .rl-tit {
padding: 20px 15px 0; padding: 20px 15px 10px;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
background-color: #fff; background-color: #fff;
...@@ -434,3 +434,63 @@ ...@@ -434,3 +434,63 @@
font-weight: normal; font-weight: normal;
} }
/*book tips*/
.tab-nav {
display: inline-block;
text-align: center;
font-size: 14px;
}
.tab-nav a {
position: relative;
display: inline-block;
height: 50px;
padding: 0 10px;
line-height: 50px;
color: #666;
}
.tab-nav a.cur {
color: #333;
}
.tab-nav a.cur:after {
content: '';
position: absolute;
width: 10px;
height: 2px;
background-color: #07c706;
left: 50%;
margin-left: -5px;
bottom: -1px;
}
.nav-main a {
position: relative;
}
.nav-main a span.file-tip {
display: inline-block;
position: absolute;
width: 170px;
height: 30px;
line-height: 30px;
background: #07c706;
color: #fff;
font-size: 12px;
border-radius: 3px;
left: 50%;
margin-left: -85px;
top:50px;
}
.nav-main a span.file-tip:after {
content: '';
left: 50%;
top: -5px;
margin-left: -10px;
display: inline-block;
position: absolute;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #07c706;
z-index: 1;
}
...@@ -833,6 +833,10 @@ ...@@ -833,6 +833,10 @@
left: 0; left: 0;
top: 0; top: 0;
} }
.detail-top-nav a.close {
left: 50px;
top: 0;
}
.detail-top-nav a.menu { .detail-top-nav a.menu {
right: 0; right: 0;
top: 0; top: 0;
......
$.fn.lazyload = function(container, fn) {
if (typeof container == "function") {
fn = container;
container = null;
}
if (!container) container = window;
container = $(container);
if (!fn) fn = $.noop;
var cache = [];
//Cached
$(this).each(function() {
var tag = this.nodeName.toLowerCase(), url = $(this).data("src");
if (url) cache.push({obj:this, tag:this.nodeName.toLowerCase(), url:url});
if (tag == "img" && !$(this).attr("src")) $(this).attr("src", "data:image/gif;base64,R0lGODlhAQABAIAAAOjo6AAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==");
});
function check() {
var contHeight = container.height();
var contop = container.get(0) === window ? container.scrollTop() : container.offset().top;
$.each(cache, function(i, data) {
if (!data.obj) return;
var o = $(data.obj), url = data.url;
var post = o.offset().top - contop;
var posb = post + o.height();
if (o.is(':visible') && (post >= 0 && post < contHeight) || (posb > 0 && posb <= contHeight)) {
if (data.tag === "img") {
fn.call(o.attr("src", url)[0]);
} else {
o.load(url, {}, function() {
fn.call(o[0]);
});
}
data.obj = null;
}
});
}
check();
container.on("scroll", check);
return this;
};
//Global page process
$(function() {
$("img.lazyload").lazyload();
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment