Difference between revisions of "Template:HFLS H2Z Hangzhou//home/rodlin/Desktop/aquamade/src/sub/model/js"
Matt Gerrard (Talk | contribs) |
Matt Gerrard (Talk | contribs) |
||
Line 1: | Line 1: | ||
;$(function () { | ;$(function () { | ||
− | + | ||
+ | function bindSticky() { | ||
$(".comsec-main .float-menu").sticky({ | $(".comsec-main .float-menu").sticky({ | ||
scrollContext: $(".main.cont-wrap"), | scrollContext: $(".main.cont-wrap"), | ||
context: $(".comsec-main"), | context: $(".comsec-main"), | ||
− | offset: 100 | + | offset: 100, |
+ | observeChanges: true | ||
}); | }); | ||
− | }, 1000); | + | } |
+ | |||
+ | setTimeout(bindSticky, 1000); | ||
function showPassage(name) { | function showPassage(name) { | ||
Line 16: | Line 20: | ||
imgview.refresh(); | imgview.refresh(); | ||
} | } | ||
+ | |||
+ | bindSticky(); | ||
}, 100); | }, 100); | ||
} | } |
Revision as of 23:47, 31 October 2017
- $(function () {
function bindSticky() { $(".comsec-main .float-menu").sticky({ scrollContext: $(".main.cont-wrap"), context: $(".comsec-main"), offset: 100, observeChanges: true }); }
setTimeout(bindSticky, 1000); function showPassage(name) { $(".comsec-main .passage.shown").removeClass("shown"); $(".comsec-main .passage.passage-" + name).addClass("shown");
setTimeout(function () { if (window.imgview) { imgview.refresh(); }
bindSticky(); }, 100); } function setUniqueActive(dom) { $(dom).siblings(".active").removeClass("active"); $(dom).addClass("active"); } $(".comsec-main .passlink").each(function (i, dom) { dom = $(dom); dom.click(function () { var passage = dom.data("passage"); if (passage) showPassage(passage); setUniqueActive(dom); $(".comsec-main .passlink").each(function (i, dom) { dom = $(dom); if (dom.data("passage") == passage) { setUniqueActive(dom); } }); }); });
});;