JQuery 1.9.1 Discarded functionality ($.browser,scrolltop,scrollleft)

Source: Internet
Author: User

jQuery1.9.1 has no longer supported, ScrollTop and ScrollLeft methods.

Personally still feel that this update is a bit too "radical", are not backward compatible. And this time it's not like browsers in the API to point out alternative methods.

The only way to do this is to set the original element to relative, and then animate{"left": Val, the contents of the "Top": val} to scroll.


without $.browser instead of using $.support


Now I want you to use feature detection, but personally feel jQuery is a bit too radical and not backwards compatible. A program that used $.browser to probe the browser will now run with errors. I am here to put the previous $.browser code to find out, easy to use browser detection of friends to use it:

The code is as follows Copy Code

(function ($) {
var a, B;
$.uamatch = function (a) {
A = A.tolowercase ();
var B =/(chrome) [/] ([w.] +)/.exec (a) | | /(WebKit) [/] ([w.] +)/.exec (a) | | /(opera) (?:. *version|) [ /] ([W.] +)/.exec (a) | | /(MSIE) ([w.] +)/.exec (a) | | A.indexof ("compatible") < 0 &&/(Mozilla) (?:. *? RV: ([w.] +)|) /.exec (a) | | [];
return {
BROWSER:B[1] | | "",
VERSION:B[2] | | "0"
}
},
A = $.uamatch (navigator.useragent),
b = {},
A.browser && (B[a.browser] =! 0, b.version = a.version),
B.chrome? B.webkit =!0:b.webkit && (B.safari =!0),
$.browser = B,
$.sub = function () {
function A (b, c) {
return new A.fn.init (b, c)
}
$.extend (!0, A, this),
A.superclass = this,
A.fn = A.prototype = This (),
A.fn.constructor = A,
A.sub = This.sub,
A.fn.init = function C (c, D) {
Return d && d instanceof p &&! (d instanceof a) && (d = A (d)),
$.fn.init.call (this, C, D, b)
},
A.fn.init.prototype = A.fn;
var B = A (e);
Return a
};
}) (JQuery);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.