...
|
...
|
@@ -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');
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -77,4 +79,22 @@ if (gotoConsultHammer) { |
|
|
gotoConsultHammer.on('tap', function() {
|
|
|
location.href = $(gotoConsultEle).find('a').attr('href');
|
|
|
});
|
|
|
} |
|
|
\ No newline at end of file |
|
|
}
|
|
|
|
|
|
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);
|
|
|
}); |
...
|
...
|
|