MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / scroll

Function scroll

examples/js/example.js:155–179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153
154//根据url滚动到页面相应的位置
155function scroll() {
156 var hash = window.location.hash;
157 var ele;
158
159 if (hash && hash.indexOf("#") !== -1) {
160 var param = hash.split("#")[1].split("-");
161 if (param.length === 1) {
162 ele = $(".category-title#title_" + param[0]);
163 selectMenu(param[0], param.length);
164 }
165
166 if (param.length == 2) {
167 //二级菜单里面的li
168 ele = $("#category-type-" + param[1]);
169 selectMenu(param[1], param.length);
170 }
171
172 }
173
174 if (ele && ele.offset()) {
175 $(window).animate({
176 scrollTop: ele.offset().top - 72
177 }, 0);
178 }
179}
180
181//绑定点击事件
182function bindEvents() {

Callers 2

initSelectFunction · 0.85
bindEventsFunction · 0.85

Calls 5

selectMenuFunction · 0.85
indexOfMethod · 0.80
offsetMethod · 0.80
$Function · 0.50
animateMethod · 0.45

Tested by

no test coverage detected