...
|
...
|
@@ -16,7 +16,9 @@ var consultFooterEle = document.getElementById('consult-content-footer'), |
|
|
navtabHammer = navtabEle && new Hammer(navtabEle),
|
|
|
|
|
|
gotoConsultEle = document.getElementById('goto-consult'),
|
|
|
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle);
|
|
|
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
|
|
|
|
|
|
$gotoConsult = $('#goto-consult');
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -78,3 +80,21 @@ if (gotoConsultHammer) { |
|
|
location.href = $(gotoConsultEle).find('a').attr('href');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function fixConsultBar() {
|
|
|
if ($(window).scrollTop() > $('#yoho-header').outerHeight()) {
|
|
|
$gotoConsult.css('position', 'fixed');
|
|
|
$gotoConsult.css('top', '0');
|
|
|
} else {
|
|
|
$gotoConsult.css('position', 'static');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//滚动时顶部固定 我要咨询
|
|
|
function scrollHandler() {
|
|
|
fixConsultBar();
|
|
|
}
|
|
|
|
|
|
$(window).scroll(function() {
|
|
|
window.requestAnimationFrame(scrollHandler);
|
|
|
}); |
...
|
...
|
|