判断条件修正

This commit is contained in:
Ricky 2020-06-30 08:58:35 +08:00
parent 3334acd494
commit eb4c67ac38
1 changed files with 2 additions and 10 deletions

View File

@ -191,16 +191,8 @@ $(function() {
'use strict'; 'use strict';
$.fn.toTop = function(opt) { $.fn.toTop = function(opt) {
var elem = this; var elem = this;
var win = $(window); var win = (opt && opt.hasOwnProperty('win')) ? opt.win : $(window);
var doc = $('html, body'); var doc = (opt && opt.hasOwnProperty('doc')) ? opt.doc : $('html, body');
if(typeof(opt) != "undefined"){
if(opt.win != null){
win = opt.win;
}
if(opt.doc != null){
doc = opt.doc;
}
}
var options = $.extend({ var options = $.extend({
autohide: true, autohide: true,
offset: 50, offset: 50,