{"id":2146,"date":"2026-11-19T23:27:23","date_gmt":"2026-11-19T15:27:23","guid":{"rendered":"https:\/\/www.zhukaifu.cn\/?p=2146"},"modified":"2026-11-19T23:27:23","modified_gmt":"2026-11-19T15:27:23","slug":"jquery-jquery-%c2%b7-%e4%b8%ad%e6%96%87%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhukaifu.cn\/?p=2146","title":{"rendered":"jquery\/jquery \u00b7 \u4e2d\u6587\u4ecb\u7ecd"},"content":{"rendered":"<!-- gh-sync:repo:jquery\/jquery -->\n\n<div id=\"gh-catalog\"><style>\/* \u4ec5\u4f5c\u7528\u4e8e\u540c\u6b65\u6587\u7ae0\uff1b\u4e0e Kai's Log \u6d45\u8272\u6587\u7ae0\u533a\u57df\u8854\u63a5\u3002 *\/\n#gh-catalog{color-scheme:light;--bg:#fff;--panel:#faf7fa;--line:#e7dee6;--text:#29252b;--muted:#69616b;--accent:#97447f;background:transparent;color:var(--text);font:inherit;line-height:1.8;min-height:0;width:100%;overflow-wrap:anywhere}\n#gh-catalog *,#gh-catalog *::before,#gh-catalog *::after{box-sizing:border-box}\n#gh-catalog main{width:100%;max-width:none;margin:0;padding:4px 0 20px}\n#gh-catalog h1,#gh-catalog h2,#gh-catalog h3{color:#29252b;font-family:inherit;font-weight:700;letter-spacing:normal;overflow-wrap:anywhere}\n#gh-catalog h1{font-size:clamp(24px,3.5vw,34px);line-height:1.4;margin:20px 0 12px}\n#gh-catalog h2{font-size:20px;line-height:1.55;margin:0 0 12px}\n#gh-catalog p{color:inherit;margin:12px 0}\n#gh-catalog a{color:var(--accent);text-decoration:none;box-shadow:none}\n#gh-catalog a:hover{text-decoration:underline;color:#753361}\n#gh-catalog .eyebrow{font-size:12px;letter-spacing:.14em;color:var(--accent);font-weight:700}\n#gh-catalog .meta,#gh-catalog .sort-note{color:var(--muted);font-size:13px}\n#gh-catalog article{background:#fff;border:1px solid var(--line);border-radius:12px;padding:24px;margin:18px 0;box-shadow:none;color:var(--text)}\n#gh-catalog article:hover{border-color:#cba8c3}\n#gh-catalog nav{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:16px 0 0}\n#gh-catalog nav a{font-size:14px}\n#gh-catalog .rank{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:30px;border-radius:7px;background:#f3edf2;color:#715568;font-size:13px;margin-right:10px;font-variant-numeric:tabular-nums}\n#gh-catalog .top-rank{background:#f8efd9;color:#765516}\n#gh-catalog .search-panel{position:static;z-index:auto;padding:20px;background:#faf7fa;border:1px solid var(--line);border-radius:12px;margin:24px 0;box-shadow:none;backdrop-filter:none}\n#gh-catalog .search-panel label{color:var(--text);font-weight:600}\n#gh-catalog .search-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:10px}\n#gh-catalog .search-row input{flex:1 1 240px;width:auto}\n#gh-catalog input,#gh-catalog select,#gh-catalog button{border:1px solid #cdbfca;border-radius:8px;background:#fff;color:#29252b;font:inherit;line-height:1.5;max-width:100%;min-height:44px;box-shadow:none}\n#gh-catalog input{width:100%;min-width:0;padding:12px 14px}\n#gh-catalog input::placeholder{color:#756b76;opacity:1}\n#gh-catalog select{padding:11px 30px 11px 12px;width:auto}\n#gh-catalog button{padding:11px 16px;cursor:pointer;white-space:nowrap;background:#f2e6ef;color:#71345e}\n#gh-catalog button:hover{background:#ead5e5;border-color:#b98aab}\n#gh-catalog .sort-label{font-size:13px}\n#gh-catalog article nav a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:9px 15px;border-radius:8px;font-size:13px;font-weight:600;border:1px solid #ddccda;background:#faf5f9;color:#80366a;text-decoration:none;box-shadow:none}\n#gh-catalog article nav a:first-child{background:#97447f;border-color:#97447f;color:#fff}\n#gh-catalog article nav a:hover{background:#f0e0eb;border-color:#b784a8;color:#71345e;text-decoration:none}\n#gh-catalog article nav a:first-child:hover{background:#7a3566;border-color:#7a3566;color:#fff}\n#gh-catalog .collected{display:inline-flex;gap:6px;flex-wrap:wrap;margin:10px 0 0;padding:4px 10px;background:#f8f4f7;border:1px solid var(--line);border-radius:6px;font-size:12px;color:#69616b}\n#gh-catalog ul,#gh-catalog ol{padding-left:1.5em;margin:14px 0;color:var(--text)}\n#gh-catalog li{margin:10px 0;color:inherit}\n#gh-catalog .empty{border:1px dashed #cdbfca;border-radius:12px;text-align:center;padding:32px 18px;color:var(--muted);background:#faf7fa}\n#gh-catalog footer{margin-top:28px;border-top:1px solid var(--line);padding-top:16px;color:var(--muted);font-size:12px}\n#gh-catalog [hidden]{display:none!important}\n#gh-catalog a:focus-visible,#gh-catalog button:focus-visible,#gh-catalog input:focus-visible,#gh-catalog select:focus-visible{outline:3px solid #97447f;outline-offset:3px}\n@media(max-width:600px){#gh-catalog main{padding:0 0 12px}#gh-catalog article{padding:18px 14px}#gh-catalog h2{font-size:18px}#gh-catalog .search-panel{padding:16px 14px}#gh-catalog .search-row input{flex-basis:100%}#gh-catalog article nav a{flex:1;padding:9px 10px}#gh-catalog .rank{min-width:32px;margin-right:8px}}\n<\/style><main><nav><a href=\"https:\/\/www.zhukaifu.cn\/?p=575\">\u2190 \u70ed\u95e8\u4ed3\u5e93\u5217\u8868<\/a><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/jquery\/jquery\">\u6253\u5f00 GitHub \u4ed3\u5e93<\/a><\/nav><h1>jquery\/jquery<\/h1><p class=\"meta\">\u2605 60,019 \u00b7 Forks 20,709<\/p><article class=\"rapid-understanding\"><section><h2>\u4e00\u53e5\u8bdd\u7406\u89e3<\/h2><p>jQuery \u662f\u4e00\u4e2a JavaScript \u5e93\u3002\u8fd9\u4e2a\u4ed3\u5e93\u63d0\u4f9b\u6e90\u7801\u548c\u6784\u5efa\u811a\u672c\uff0c\u53ef\u4ee5\u6309\u9ed8\u8ba4\u914d\u7f6e\u751f\u6210\u5e93\u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u6309\u5e94\u7528\u9700\u8981\u88c1\u526a\u6a21\u5757\u3002\u88c1\u526a\u8981\u6cbf\u7740\u4f9d\u8d56\u5173\u7cfb\u770b\uff1a\u4e00\u4e2a\u6a21\u5757\u88ab\u79fb\u9664\uff0c\u4f9d\u8d56\u5b83\u7684\u529f\u80fd\u4e5f\u53ef\u80fd\u968f\u4e4b\u6d88\u5931\u3002<\/p><\/section><section><h2>\u5b83\u89e3\u51b3\u4ec0\u4e48\u95ee\u9898<\/h2><p>\u7f51\u9875\u811a\u672c\u5e38\u8981\u5904\u7406\u70b9\u51fb\u7b49\u4e8b\u4ef6\u3001\u4fee\u6539\u5143\u7d20\u6837\u5f0f\u6216\u64ad\u653e\u52a8\u753b\uff0cjQuery \u4e3a\u8fd9\u4e9b\u64cd\u4f5c\u63d0\u4f9b\u73b0\u6210\u7684\u65b9\u6cd5\u3002\u81ea\u5df1\u6784\u5efa\u65f6\uff0c\u8f93\u5165\u662f\u4ed3\u5e93\u6e90\u7801\u548c\u6784\u5efa\u9009\u9879\uff0c\u8f93\u51fa\u662f\u9875\u9762\u53ef\u4ee5\u52a0\u8f7d\u7684\u5e93\u6587\u4ef6\u3002\u6210\u529f\u6709\u4e24\u4e2a\u68c0\u67e5\u70b9\u3002\u5148\u786e\u8ba4\u751f\u6210\u4e86\u9884\u671f\u6587\u4ef6\uff0c\u518d\u7528\u76ee\u6807\u9875\u9762\u786e\u8ba4\u5b83\u5b9e\u9645\u7528\u5230\u7684\u65b9\u6cd5\u4ecd\u7136\u53ef\u7528\u3002\u5bf9\u4e8e\u5b9a\u5236\u6784\u5efa\uff0c\u53ea\u770b\u5230\u6587\u4ef6\u751f\u6210\uff0c\u8fd8\u9700\u8981\u505a\u7b2c\u4e8c\u9879\u68c0\u67e5\u3002<\/p><\/section><section><h2>\u4ece\u8f93\u5165\u5230\u8f93\u51fa<\/h2><p>\u4ece\u6e90\u7801\u5230\u9875\u9762\u53ef\u4ee5\u5206\u56db\u6b65\u3002\u7b2c\u4e00\u6b65\uff0c\u51c6\u5907 Git 1.7 \u6216\u66f4\u9ad8\u7248\u672c\u4ee5\u53ca\u6700\u65b0\u7248 Node.js \u548c npm\uff0c\u514b\u9686\u4ed3\u5e93\u3002\u8fdb\u5165\u4ed3\u5e93\u76ee\u5f55\u540e\u8fd0\u884c npm install\uff0c\u56e0\u4e3a\u6784\u5efa\u811a\u672c\u9700\u8981\u9879\u76ee\u4f9d\u8d56\uff0c\u7f3a\u5c11\u4f9d\u8d56\u65f6\u5e94\u5148\u8865\u9f50\u518d\u6784\u5efa\u3002\u7b2c\u4e8c\u6b65\uff0c\u51b3\u5b9a\u9700\u8981\u54ea\u4e9b\u529f\u80fd\u3002\u9ed8\u8ba4\u8fd0\u884c npm run build\uff0c\u4e5f\u53ef\u4ee5\u7528 &#8211;exclude \u88c1\u526a\u6a21\u5757\u3002core \u5fc5\u987b\u4fdd\u7559\uff0c\u79fb\u9664 css \u4f1a\u8fde\u5e26\u79fb\u9664\u52a8\u753b\u3001\u5c3a\u5bf8\u548c\u4f4d\u7f6e\u7b49\u4f9d\u8d56\u5b83\u7684\u6a21\u5757\u3002\u7b2c\u4e09\u6b65\uff0c\u68c0\u67e5\u4ea7\u7269\u3002\u9ed8\u8ba4\u751f\u6210\u7684 jquery.js \u653e\u5728 dist\/\uff0c\u540c\u76ee\u5f55\u8fd8\u6709\u538b\u7f29\u7248\u548c\u5bf9\u5e94\u7684\u6e90\u7801\u6620\u5c04\u6587\u4ef6\u3002\u7b2c\u56db\u6b65\uff0c\u5728\u76ee\u6807\u73af\u5883\u52a0\u8f7d\u4ea7\u7269\u3002\u9ed8\u8ba4\u6784\u5efa\u4f9d\u8d56\u5168\u5c40 window\uff0c\u7f3a\u5c11\u8fd9\u4e2a\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u9009\u62e9\u5de5\u5382\u6784\u5efa\uff0c\u5e76\u5728\u8c03\u7528\u65f6\u4ece\u5916\u90e8\u4f20\u5165 window\u3002<\/p><\/section><section><h2>\u7528\u4e00\u4e2a\u5c0f\u4efb\u52a1\u7406\u89e3<\/h2><p><strong>\u7406\u89e3\u793a\u4f8b\uff08\u672a\u5b9e\u6d4b\uff09\uff1a<\/strong>\u8bbe\u60f3\u505a\u4e00\u4e2a\u53ef\u6536\u8d77\u7684\u5e2e\u52a9\u9762\u677f\u3002\u51c6\u5907\u4e00\u4e2a\u6309\u94ae\u548c\u4e00\u5757\u521d\u59cb\u53ef\u89c1\u7684\u9762\u677f\uff0c\u5728\u6d4b\u8bd5\u9875\u9762\u52a0\u8f7d\u9ed8\u8ba4\u6784\u5efa\u751f\u6210\u7684 jquery.js\u3002\u7ed9\u6309\u94ae\u7ed1\u5b9a .on() \u70b9\u51fb\u5904\u7406\uff0c\u8ba9\u5904\u7406\u51fd\u6570\u5bf9\u9762\u677f\u8c03\u7528 .slideUp()\u3002\u8f93\u5165\u662f\u8fd9\u4e24\u4e2a\u9875\u9762\u5143\u7d20\u548c\u4e00\u6b21\u70b9\u51fb\uff0c\u5904\u7406\u8fc7\u7a0b\u662f\u5148\u89e6\u53d1\u56de\u8c03\uff0c\u518d\u7531\u52a8\u753b\u65b9\u6cd5\u6536\u8d77\u9762\u677f\u3002\u9884\u671f\u80fd\u770b\u5230\u9762\u677f\u5411\u4e0a\u6536\u8d77\u3002\u53ef\u4ee5\u5728\u56de\u8c03\u5165\u53e3\u8bbe\u7f6e\u65ad\u70b9\uff0c\u5206\u522b\u89c2\u5bdf\u70b9\u51fb\u662f\u5426\u8fdb\u5165\u56de\u8c03\uff0c\u4ee5\u53ca\u8fdb\u5165\u540e\u9762\u677f\u662f\u5426\u6536\u8d77\u3002<\/p><\/section><section><h2>\u6539\u53d8\u4e00\u4e2a\u6761\u4ef6\u4f1a\u600e\u6837<\/h2><p><strong>\u9884\u6d4b\u4e0e\u9a8c\u8bc1\uff08\u5f85\u68c0\u9a8c\uff09\uff1a<\/strong>\u7528\u540c\u4e00\u4efd\u6e90\u7801\u3001\u540c\u4e00\u4e2a\u6d4b\u8bd5\u9875\u9762\u548c\u540c\u4e00\u4e2a\u6d4f\u89c8\u5668\u505a\u4e24\u8f6e\u5bf9\u7167\uff0c\u53ea\u6539\u53d8\u4e00\u4e2a\u6784\u5efa\u6761\u4ef6\u3002\u7b2c\u4e00\u8f6e\u7528\u9ed8\u8ba4\u6784\u5efa\uff0c\u7b2c\u4e8c\u8f6e\u7528 npm run build &#8212; &#8211;exclude=css\u3002\u9884\u6d4b\u7b2c\u4e8c\u8f6e\u4ecd\u80fd\u5728\u70b9\u51fb\u540e\u8fdb\u5165\u56de\u8c03\uff0c\u4f46\u8c03\u7528 .slideUp() \u65f6\u4f1a\u56e0\u8be5\u65b9\u6cd5\u7f3a\u5931\u800c\u62a5\u9519\uff0c\u9762\u677f\u4e5f\u4f1a\u4fdd\u6301\u53ef\u89c1\u3002\u539f\u56e0\u662f\u52a8\u753b\u6a21\u5757\u4f9d\u8d56 css\uff0c\u4e8b\u4ef6\u6a21\u5757\u5355\u72ec\u63d0\u4f9b .on()\u3002\u9a8c\u8bc1\u65f6\u5206\u522b\u52a0\u8f7d\u4e24\u8f6e\u4ea7\u7269\uff0c\u70b9\u51fb\u524d\u786e\u8ba4\u9875\u9762\u8f7d\u5165\u7684\u662f\u5bf9\u5e94\u6587\u4ef6\uff0c\u70b9\u51fb\u540e\u68c0\u67e5\u65ad\u70b9\u3001\u63a7\u5236\u53f0\u548c\u9762\u677f\u72b6\u6001\u3002\u8fd9\u6837\u80fd\u533a\u5206\u70b9\u51fb\u5904\u7406\u6709\u6ca1\u6709\u89e6\u53d1\uff0c\u4ee5\u53ca\u52a8\u753b\u65b9\u6cd5\u662f\u5426\u53ef\u7528\u3002<\/p><\/section><section><h2>\u9002\u5408\u8c01\uff0c\u54ea\u91cc\u4f1a\u5931\u6548<\/h2><p><strong>\u6839\u636e\u8d44\u6599\u63a8\u65ad\uff1a<\/strong>\u9700\u8981\u4ece\u6e90\u7801\u6784\u5efa jQuery\u3001\u6392\u67e5\u88c1\u526a\u540e\u7f3a\u5c11\u54ea\u4e2a\u65b9\u6cd5\uff0c\u6216\u7ef4\u62a4\u65e7\u7248\u9879\u76ee\u7684\u5f00\u53d1\u8005\uff0c\u53ef\u4ee5\u7528\u8fd9\u4e2a\u4ed3\u5e93\u6838\u5bf9\u6a21\u5757\u548c\u6784\u5efa\u65b9\u5f0f\u3002\u975e\u5b98\u65b9\u5b9a\u5236\u6784\u5efa\u7f3a\u5c11\u5e38\u89c4\u6d4b\u8bd5\u8986\u76d6\uff0c\u5e2e\u52a9\u9762\u677f\u7684\u7ed3\u679c\u53ea\u8986\u76d6\u8fd9\u4e00\u6761\u4ea4\u4e92\u3002\u6d4f\u89c8\u5668\u6700\u4f4e\u652f\u6301\u7248\u672c\u9700\u8981\u53e6\u67e5\u652f\u6301\u8868\uff0c\u6240\u7ed9\u7247\u6bb5\u53ea\u6709\u5165\u53e3\u3002\u65e7\u9879\u76ee\u8fd8\u8981\u7559\u610f\u7ef4\u62a4\u8303\u56f4\uff0c4.x \u83b7\u5f97\u5b8c\u6574\u652f\u6301\uff0c3.x \u4ec5\u63a5\u6536\u5173\u952e\u66f4\u65b0\uff0c1.x \u548c 2.x \u5df2\u505c\u6b62\u652f\u6301\u3002<\/p><\/section><section><h2>\u7b2c\u4e00\u6b21\u5c1d\u8bd5\u65f6\u770b\u4ec0\u4e48<\/h2><p><strong>\u6839\u636e\u8d44\u6599\u63a8\u65ad\uff1a<\/strong>\u5148\u7528\u9ed8\u8ba4\u6784\u5efa\u8dd1\u901a\u9762\u677f\u6848\u4f8b\uff0c\u518d\u505a\u4e00\u6b21\u6392\u9664 css \u7684\u5bf9\u7167\u3002\u5982\u679c\u51c6\u5907\u628a\u5b9a\u5236\u4ea7\u7269\u7528\u5230\u771f\u5b9e\u9879\u76ee\uff0c\u5148\u5217\u51fa\u9875\u9762\u548c\u63d2\u4ef6\u5b9e\u9645\u8c03\u7528\u7684\u65b9\u6cd5\uff0c\u9010\u9879\u6838\u5bf9\u6a21\u5757\u5f52\u5c5e\uff0c\u518d\u7528\u5b9a\u5236\u4ea7\u7269\u590d\u67e5\u5bf9\u5e94\u4ea4\u4e92\u3002\u9700\u8981\u8dd1\u4ed3\u5e93\u5355\u5143\u6d4b\u8bd5\u65f6\uff0c\u4ece\u4ed3\u5e93\u6839\u76ee\u5f55\u542f\u52a8\u652f\u6301 PHP \u7684\u672c\u5730\u670d\u52a1\u5668\u3002<\/p><\/section><\/article><\/main><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u2190 \u70ed\u95e8\u4ed3\u5e93\u5217\u8868\u6253\u5f00 GitHub \u4ed3\u5e93 jquery\/jquery \u2605 60,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2146","post","type-post","status-publish","format-standard","hentry","category-thinking"],"_links":{"self":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/2146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2146"}],"version-history":[{"count":2,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/2146\/revisions"}],"predecessor-version":[{"id":2272,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/2146\/revisions\/2272"}],"wp:attachment":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}