ios的fouse失效?

遇到问题了,在ios上input框fouse()失效,差了好多网上的资料,
最后总结到下面这个
 $.fn.selectRange = function(start, end) {  
    return this.each(function() {  
        if (this.setSelectionRange) {  
            this.focus();  
            this.setSelectionRange(start, end);  
        } else if (this.createTextRange) {  
            var range = this.createTextRange();  
            range.collapse(true);  
            range.moveEnd('character', end);  
            range.moveStart('character', start);  
            range.select();  
        }  
    });  
};
 
有效的解决了我的问题

猜你喜欢

转载自www.cnblogs.com/boomBoy/p/9020806.html