Boolean education jQuery practical video material sharing
jQuery is a fast and concise JavaScript framework. It is another excellent JavaScript code library (or JavaScript framework) after Prototype. The purpose of jQuery's design is "write less, do more", which means writing less code and doing more things. It encapsulates common JavaScript function codes, provides a simple JavaScript design pattern, and optimizes HTML document operations, event processing, animation design and Ajax interaction. We have collected the "Boolean Education jQuery Practical Video Tutorial", hoping to help everyone learn jQuery better.
Video playback address: http://www.php.cn/course/319.html
Related topic recommendations: "jquery practical video"
Summary of jquery difficulties:
1 How to pass parameters in jquery binding event
$("#btn").bind("click",{"id":"111","name":"aaa"}, getData); function getData(d) { alert(d.data.id); alert(d.data["name"]) }
2 How to call in setTimeout Object methods
setTimeout( function(self) { return function() { alert(self);//这里面用self代替this } }(this), 1000);
3 The difference between this and $(this)
Concept:
This indicates that the current context object is an html object, and you can call the attributes and properties owned by the html object The context object represented by the method, $(this), is a jquery context object, which can call jquery's methods and attribute values.
What does $() generate? In fact, $()=jquery() means that it returns a jquery object.
Usually we use $() directly for simplicity. In fact, this function omits a parameter context. Select the matching object based on the selector, that is, $(selector, context), and return it in the form of a jQuery wrapper set. Context can be a collection of Dom objects or a jQuery packaging set. If passed in, it means that the matching object is to be selected from the context. If it is not passed in, it means that the scope is the document object (that is, all objects on the page), that is, $(selector)=$(selector, document).
This refers to the html object that calls the function.
Example:
$("#textbox").hover( function() { this.title = "Test"; }, fucntion() { this.title = "OK”; } );
This here is actually an Html element (textbox), and this is in js. The textbox has a text attribute, so there is no problem in writing it this way.
$("#textbox").hover( function() { $(this).title = "Test"; }, function() { $(this).title = "OK"; } );
$(this) here is a JQuery object, and the jQuery object does not have a title attribute, so writing this is wrong.
Summary:
This means that the current context object is an html object, and you can call the properties and methods owned by the html object.
$(this), the context object represented is a jquery context object, which can call jquery methods and attribute values.
4 app font adaptive
//使用rem策略,不断更新html的fontsize (function(){ function sizeHtml(){ var size = $(window).width()/16; size = size>40?40:size; $("html").css("font-size",size+"px"); } sizeHtml(); $(window).resize(function(){ sizeHtml(); }) })()
The above is the detailed content of Boolean education jQuery practical video material sharing. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP Practice: Code Example to Quickly Implement the Fibonacci Sequence The Fibonacci Sequence is a very interesting and common sequence in mathematics. It is defined as follows: the first and second numbers are 0 and 1, and from the third Starting with numbers, each number is the sum of the previous two numbers. The first few numbers in the Fibonacci sequence are 0,1,1.2,3,5,8,13,21,...and so on. In PHP, we can generate the Fibonacci sequence through recursion and iteration. Below we will show these two

How to remove the height attribute of an element with jQuery? In front-end development, we often encounter the need to manipulate the height attributes of elements. Sometimes, we may need to dynamically change the height of an element, and sometimes we need to remove the height attribute of an element. This article will introduce how to use jQuery to remove the height attribute of an element and provide specific code examples. Before using jQuery to operate the height attribute, we first need to understand the height attribute in CSS. The height attribute is used to set the height of an element

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <

Title: Use jQuery to modify the text content of all a tags. jQuery is a popular JavaScript library that is widely used to handle DOM operations. In web development, we often encounter the need to modify the text content of the link tag (a tag) on the page. This article will explain how to use jQuery to achieve this goal, and provide specific code examples. First, we need to introduce the jQuery library into the page. Add the following code in the HTML file:

The data export function is a very common requirement in actual development, especially in scenarios such as back-end management systems or data report export. This article will take the Golang language as an example to share the implementation skills of the data export function and give specific code examples. 1. Environment preparation Before starting, make sure you have installed the Golang environment and are familiar with the basic syntax and operations of Golang. In addition, in order to implement the data export function, you may need to use a third-party library, such as github.com/360EntSec

How to tell if a jQuery element has a specific attribute? When using jQuery to operate DOM elements, you often encounter situations where you need to determine whether an element has a specific attribute. In this case, we can easily implement this function with the help of the methods provided by jQuery. The following will introduce two commonly used methods to determine whether a jQuery element has specific attributes, and attach specific code examples. Method 1: Use the attr() method and typeof operator // to determine whether the element has a specific attribute

jQuery is a popular JavaScript library that is widely used to handle DOM manipulation and event handling in web pages. In jQuery, the eq() method is used to select elements at a specified index position. The specific usage and application scenarios are as follows. In jQuery, the eq() method selects the element at a specified index position. Index positions start counting from 0, i.e. the index of the first element is 0, the index of the second element is 1, and so on. The syntax of the eq() method is as follows: $("s
