Difference between revisions of "Template:BNU-CHINA/article"
Line 17: | Line 17: | ||
var baseline = $("#top_menu_14").height(); | var baseline = $("#top_menu_14").height(); | ||
− | |||
$(".sub-header").css({ | $(".sub-header").css({ | ||
− | + | "transform": "translate3D(0, -100%, 0)", | |
− | + | "top": baseline + "px" | |
}); | }); | ||
$("article h2").each(function (index, item) { | $("article h2").each(function (index, item) { | ||
+ | var $temp = $(item).clone(); | ||
+ | $temp.children().remove(); | ||
$("ul.sub-nav").append($("<li>").append( | $("ul.sub-nav").append($("<li>").append( | ||
$("<a>").addClass("btn-filter btn") | $("<a>").addClass("btn-filter btn") | ||
.attr("data-tartget", index) | .attr("data-tartget", index) | ||
− | .text($ | + | .text($temp.text()) |
)); | )); | ||
}); | }); | ||
Line 34: | Line 35: | ||
$("ul.sub-nav").append($("<li>").append( | $("ul.sub-nav").append($("<li>").append( | ||
$("<a>").addClass("btn-filter btn") | $("<a>").addClass("btn-filter btn") | ||
− | + | .attr("href", "#") | |
− | + | .text("Top ▴") | |
)); | )); | ||
Line 61: | Line 62: | ||
if($(window).scrollTop() + $(window).height() == $(document).height()) { | if($(window).scrollTop() + $(window).height() == $(document).height()) { | ||
− | + | currentIdx = $("article h2").length - 1; | |
} | } | ||
Line 67: | Line 68: | ||
"color": "#278A75" | "color": "#278A75" | ||
}); | }); | ||
− | + | ||
if (currentIdx >= 0) { | if (currentIdx >= 0) { | ||
$($("ul.sub-nav a")[currentIdx]).css({ | $($("ul.sub-nav a")[currentIdx]).css({ |
Revision as of 00:27, 19 September 2015