Read about jquery smooth div scroll example, The latest news, videos, and discussion topics about jquery smooth div scroll example from alibabacloud.com
This example shows a simple div drag. In addition, you can add the corresponding code as needed to achieve the desired effect, as shown below, if you like it, please support this example as a very simple p-drag. If you need it, you can add the corresponding code as needed. Welcome to shoot bricks
The Code is as follows:
P width resize
JQuery implements the example code (Common Code) for div drag at will, jquerydiv
Pay attention to the js location, which should be placed close to it. If it is overwritten by others, it cannot be moved.
For example:
Introduce jquery. js,
This article describes how to set the content of jquery. The following example shows how to set the content through the text (), html (), and val () methods. For more information, see.
Jquery settings-Text (), html (), and val ()
We will use three identical methods in the previous chapter to set the content:
Text ()-set or return the text content of the selecte
, you can set multiple css attributes at a time.The returned result is still wrapped set to facilitate JQuery chained operations.For example: The code is as follows:Copy code $ ('Div: eq(0w.'hangzhou.css ({'Font-size': '2em ','Color': '# cc00ff'}); It is depressing that the attribute name of this Object must be enclose
Jquery is a simple example of adding a click event to a DIV, jqueryclick
Today, when I was doing a lottery activity, I made up a prompt directly after I did not win the lottery. Then I added an event to the div. Let's take a look at this example.
Html
Example of Div window vibration effect implemented by jQuery and jquerydiv window
This article describes the Div window vibration effect implemented by jQuery. Share it with you for your reference. The details are as follows:
This is a j
The example of this article describes the effect of the div window shaking implemented by jquery. Share to everyone for your reference. Specifically as follows:
This is a jquery window vibration effect code, within the div frame Click Mouse, it began to vibrate, applicable
Simple instance of the jquery div modal window
Above the jquery div modal window is a simple example of the small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.
The example in this paper describes the effect of the div window Vibration of jQuery . Share to everyone for your reference. Specific as follows:This is a jquery window Shake effect code, in the div border click the mouse, it began to vibrate, applicable browser: IE8, 360, F
We will use three identical methods in the previous chapter to set the content:
Text ()-set or return the text content of the selected ElementHtml ()-set or return the content of the selected element (including HTML tags)Val ()-set or return the value of a form field
1. html () method
This method is similar to the innerHTML attribute in js.
$ ("# Two" ).html () method to obtain html
$ ("# Two" ).html ("
2. text ()
Similar to the innerText attribute in JS
$ ("
Example of Div window vibration effect implemented by jQuery and jquerydiv window
This article describes the Div window vibration effect implemented by jQuery. Share it with you for your reference. The details are as follows:
This is a j
jquery Jquery.offset (). Top/left is used to get the div distance from the window, Jquery.position (). Top/left is used to get the distance from the parent div (must be an absolutely positioned div).(1) First introduce Jquery.offset (). Top/leftCss:
Copy Code code as follows:
*{margin:0px; padding:0px;}
This article mainly introduces the resize event of the div under jquery written by a great God. For more information, seeThis is the resize event of the div under jquery written by a great god. The Code is as follows: // resize of div (function ($, h, c) {var a = $ ([]), e =
Body is very long, can slide, body Head has a simulation drop-down selection box. The Drop-down selection has a scroll axis, as shown below.
I give the body a overflow:hidden and height is no use. Mobile website background can still slide, and then I give the body a touchmove preventdefault () to prevent the event, the bodies slide organization, the PC above is OK, but the phone above the sliding di
The instance is as follows:
Above this jquery to implement div horizontal drag-and-drop sort of simple example is small to share all the content of everyone, hope to give you a reference, but also hope that we support cloud habitat community.
The example in this article describes the way jquery controls div Drag-and-drop effects. Share to everyone for your reference. as follows:
I hope this article will help you with your jquery programming.
1.toggle
Toggles the hiding and displaying of objects, which can be used instead of show and hide
2.fadeIn fadeout
FadeIn fade in (would have been hidden), Fadeout fade (originally displayed)
Fadeout
When you fade out, the space will be hidden and the module below will move up.
FadeIn
3.fadeTo
Switch to a specified transparency: 0 indicates total transparency, and 1 is opaque.
4.slideUp and Slidedown
Slideup: Slide Hidden Object up
Slid
The code is as follows, please add it to the head of the page
The code is as follows
Copy Code
Using JavaScript to implement
Change the element ID in the following code to the element ID that needs to implement the effect and place it anywhere on the page
The code is as follows
Copy Code
↑↑ This method is very good ~ recommend the use of this ~↑↑Using jquery to implemen
Html
jquery Events
$ (' #click_ms '). Click (function () {Alert (1);$.post ("ajax.php", {"Time": if (data = = 1) {Tusi (' Congratulations on getting a movie ticket 1! ');else if (data = 2) {Tusi (' Sorry you didn't smoke, please try again tomorrow! ');}});})
To see a core of the sentence above
$ ("#click_ms"). Live ("Click", Function () {Tusi (' Sorry you didn't smoke, please try again tomorrow! '); return false;});
This is to tell the #click_m
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.