天天看點

話說前端46-jQuery

作者:LearningYard學苑
話說前端46-jQuery

分享興趣,傳播快樂,增長見聞,留下美好!

親愛的您,這裡是LearningYard新學苑。

今天小編為大家帶來話說前端46-jQuery,歡迎您的通路。

Share interests, spread happiness, increase knowledge, and leave a good legacy!

Dear you, this is The LearningYard Academy.

Today Xiaobian brings you The knowledge set 46| the lingo model of the maximum coverage model, welcome to your visit.

JQuery 概述:jQuery是一個快速、簡潔的JavaScript庫,在這個庫中,封裝了很多預先定義好的函數在裡面,比如動畫animate、hide、show,比如擷取元素等。jQuery版本分兩種類型:壓縮版本: 省略寫法,不利于閱讀,體積小。項目上線使用未壓縮版本:完整寫法,利于閱讀,體積大。學習和開發階段使用。Query下載下傳:官網:https://jquery.com/點選Download,找到對應的版本連結,點選,右擊另存為。

Overview of JQuery: jQuery is a fast and concise JavaScript library. In this library, many predefined functions are encapsulated, such as animate, hide and show, such as getting elements. There are two types of jQuery version: compressed version: omitted writing, which is not conducive to reading and small in size. The uncompressed version used in the project online: complete writing, easy to read and large in size. Used in learning and development stages. Query Download: official website: https://jquery.com/ Click Download to find the corresponding version link, click, and right-click Save As.

JQuery 選擇器:

JQuery selector:

話說前端46-jQuery

總結: 就是和 css 的 選擇器基本是一樣的,但是要加引号

Summary: It is basically the same as the selector of css, but with quotation marks.

JQuery 入口函數:為了防止文檔在完全加載(就緒)之前運作jquery代碼,即在DOM加載完成之後才可以對 DOM 進行操作 使用ready函數.推薦使用 簡寫方式。

JQuery entry function: In order to prevent the document from running jquery code before it is fully loaded (ready), that is, the ready function can only be used after the DOM is loaded. Shorthand is recommended.

話說前端46-jQuery

onload 和 ready:onload被成為javaScript的入口函數,reday被成為jQuery的入口函數

onload和ready的差別:window.onload 事件是等到所有内容,包括外部圖檔之類的檔案加載完後,才會執行。ready 是在 html 所有标簽(DOM)都加載之後,就會去執行。window.onload 事件隻能執行一次,再寫就會覆寫。ready 是可以執行多次,并且不會被覆寫。

Onload and ready:onload are the entry functions of javaScript, and reday is the entry function of jQuery.

The difference between onload and ready: the window.onload event will not be executed until all contents, including files such as external pictures, are loaded. Ready is executed after all html tags (DOM) are loaded. The window.onload event can only be executed once, and then it will be overwritten. Ready can be executed multiple times and will not be overwritten.

JQuery 選擇器:

JQuery selector:

話說前端46-jQuery

今天的分享就到這裡了。如果您對今天的文章有什麼獨特的想法,歡迎評論留言,讓我們相約明天,祝您今天過得開心快樂!

That's it for today's sharing. If you have any unique ideas for today's article, please leave a comment, let us meet tomorrow, I wish you a happy day!

翻譯:google翻譯

本文由LearningYard新學苑原創,部分圖檔文字來自網絡,如有侵權請聯系。

文字&排版|李仕陽

稽核|李煥