Files
weiyu/visitor/web/pc/js/float.js
jack ning 8a84e6b738 update
2024-04-05 15:53:09 +08:00

48 lines
1.5 KiB
JavaScript
Executable File

$(function () {
// $(window).on('scroll', function () {
// var st = $(document).scrollTop();
// if (st > 0) {
// // if ($('#main-container').length != 0) {
// // var w = $(window).width(), mw = $('#main-container').width();
// // if ((w - mw) / 2 > 70)
// // $('#go-top').css({ 'left': (w - mw) / 2 + mw + 20 });
// // else {
// // $('#go-top').css({ 'left': 'auto' });
// // }
// // }
// $('#go-top').fadeIn(function () {
// $(this).removeClass('dn');
// });
// } else {
// $('#go-top').fadeOut(function () {
// // $(this).addClass('dn');
// });
// }
// });
$('#go-top .go').on('click', function () {
$('html,body').animate({ 'scrollTop': 0 }, 500);
});
$('#go-top .uc-2vm').hover(function () {
$('#go-top .uc-2vm-pop').removeClass('dn');
}, function () {
$('#go-top .uc-2vm-pop').addClass('dn');
});
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
document.createTextNode(
'@-ms-viewport{width:auto!important}'
)
)
document.querySelector('head').appendChild(msViewportStyle)
}
});