In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article Xiaobian introduces in detail "how to use jQuery and Ajax to build Internet applications", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to build Internet applications with jQuery and Ajax" can help you solve your doubts.
Effects module
It is easy to conclude from its name that the Effects module contains only animations and effects that some "regular" Web pages try to avoid. But this is not the case. Almost all applications encounter situations where a page element needs to be hidden or its view should be switched according to the state of another page element. Such changes are important for an RIA because they allow you to load all the page elements of a page and then show only the information you need by hiding / showing specific elements. It is not advisable to reload the page. For example, a combo box with two options, one is to hide the div, and the other is to show the div. Obviously, it is easier and more efficient to hide / show this div with client-side code than to change the combo box and reload the page hide / show div. Whether you just hide / show or let it fade in / out is entirely up to you.
As mentioned above, the most basic effect functions are the show () and hide () functions. This is very straightforward; they can be used to show and hide an element on the page, respectively.
Listing 1. The following are referenced contents of hide and show functions: / / shows every
On the page$ ("p") .show (); / / hides every
On the page$ ("p") .hide (); / / hides every other
On the page$ (p:odd) .hide ()
In addition to these basic operations, you can also have more control over how page elements are displayed and hidden using the functions show () and hide (). The relevant documentation describes hide () as a "graceful" show / hide, and for show (), a combination of fade-in and slide-out effects.
Before delving into some examples, you might want to go back and look at the parameters passed to these effect functions. Each function (except the generic show () and hide () functions) allows you to pass in the speed and function to be called when the effect is complete. Speed is used to control the speed of the effect. This parameter can be a "slow", "fast", or "normal" string. In addition, if you need to accurately control the animation time, you need to specify the number of milliseconds with parameters. The second argument to the Effects function is itself a function, which is called after the effect is complete. This is important if you want to combine several effects into a larger effect, because you can reliably control when one effect is completed and when the next effect begins.
Listing 2. The compound effect is as follows: / / the img with an ID of "picture" should start hidden// when the "showPicture" button is pressed, show the img with an ID of "picture" / / and animate it, so it appears quickly in a fade In and slide out, and when// it's done being shown, show the caption of the picture, which is// always in the span right after the
Tag
This is the picture's caption// jQuery code inside the document.ready () function$ ("# picture"). Hide (). Next (). Hide (); $("# showPicture") .click (function () {$("# picture"). Show ("fast", function () {$("# picture"). Next (). Show ();}); / / notice how it took more text to describe what you want to happen than it took// to actually code it!
The Effects module has other functions that are very similar to show () and hide (), and end up with basically the same functionality; only in a different way. The slideDown () and slideUp () functions are used to show and hide a page element, respectively. However, this is achieved by the animation effect of sliding the element down or up (as you can easily see from its name). Similar to the enhanced hide () and show () functions I just mentioned, you can also control the speed of sliding and the functions to be called when the effect is complete. In addition, there is another option to show / hide the page element, namely the fadeIn () and fadeOut () functions, which, as their name suggests, fade the page element until it is transparent, and then make it disappear. They allow you to customize the speed and the function to be called when the effect is complete.
After reading this, the article "how to build Internet applications with jQuery and Ajax" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it. If you want to know more about the article, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.