jquery Plugin Development modelSoftware development process is the need for certain design patterns to guide development, with the model, we can better organize our code, and from these predecessors summed up the model learned a lot of good practice.According to the description of jquery advanced programming, there are three main ways to develop
To fully reflect the easy-to-use interaction functions of the software on the UI, standalone jquery and Struts2-jquery-plugin are used for verification (available regular expressions) and auto-completion. Auto-completion is performed in real time from the database.
Independent functions are implemented. Because they are not completed on a
development of JS Plug-ins, is the same, we use a self-invoke anonymous function to write their own code wrapped up, it can! The package method is as follows:
(function () {
}) ()
Wrap it up with the top, and it's OK.
But there is another problem, when we look at Daniel's code, we often see ";" in order to avoid unnecessary errors such as code merging.
For example, we literally define a function:
var haoroomsblog=function () {
}
(function () {
}) ()
Because
() () {var a=100;})();alert (a); Pop up 1More closures and anonymous functions can see the anonymous functions of javascript with self-executing this post.Three or one step by step package jquery PluginNext, let's write a highlight Jqury plugin.1. Set a closure area to prevent the plug-in "pollution"Closure-qualified namespace (function ($) { }) (Window.jquery);2.jquery.fn.extend (object) extends the
JQuery image carousel Plugin-mandatory for front-end development and mandatory for jquery
I still remember that when I first came into contact with the front-end, I browsed all the major websites and most of them had a carousel effect. At that time, I was a completely thorough hacker, it is really interesting to think about how to scroll these images in one direc
First, find Jquery-qrcode in github, select download Zip download (click to open link)After downloading to get a compressed package jquery-qrcode-master.zip, unzip, the inside of the SRC folder out, put to the site directory,After that, download the latest version of jquery1.x from the official website of jquery, usually 1.11 (click the Open link) instead of 2.X,
Jquery Plugin-fullpage. js, jquery-fullpage.js
BytesIntroduction
FullPage. js is a jQuery-based plug-in that can easily create full-screen websites. Its main functions include:
Supports mouse scrolling
Supports forward and backward navigation and keyboard control
Multiple callback Functions
Support for mobile phon
Jcuploadjcupload is an AJAX file upload component implemented using Flash and jquery. Support File upload progress bar hint. Support multi-file upload, the user can press the CTRL or SHIFT key in the File selection box to select multiple files at once. Supports custom file extension filtering, limits individual file sizes, and controls the queue Size/number of files to be uploaded. Easy to customize appearance.
View Details
Tags:
is very simple, that is, find the p under the p class pane and hide it. What we need to achieve next is that when the user points to h1, the corresponding p TAG content is displayed, and the content of the p tag corresponding to other h1 is hidden. The Code is as follows:
The Code is as follows:
// Set the click event for the h1 tagSelf. delegate ('h1 ', 'click', function (){// Set the slideToggle effect for the corresponding p tag$ (This). next ('P'). slideToggle (600)// Obtain other pane o
$ (function() { $ ("#filterName"). KeyUp (function() { $ ( "Table tbody tr"). Hide () . Filter (": Contains ('" + ($ (this). Val ()) + "')"). Show (); });}) ; // This is generally not used, because we want the table is usually the page, and then go to the background to check the filter, and then pass the data to the foreground.
Well, the rest of this chapter is fried leftovers, the only new function isvar $div _li=$ ("Li"), $div _li.click (function() { var index= $d
A Plugin Development PatternRead 107 comments by Mike Alsup
I ' ve been developing jQuery plugins for quite a while now, and I ' ve become rather comfortable with a particular style of P Lugin development for my scripts. This article was meant to share the pattern that I ' ve found especially useful for plugin authoring. It assumes you already has an understandin
The JQuery Lightbox Lightbox plugin allows you to showcase elegant images, videos and other content (using modal windows) for your website and applications. If you are a developer, you must have a collection of jQuery Lightbox Plugins, because some of the customers will ask their site to look more appealing and visually compelling.So in this collection, we've com
Practical jquery Paging Effect plug-in jquery.pagination.js, based on the jquery implementation, according to the Pageselectcallback function callback call through AJAX call Dynamic Data, the current method is to generate JSON data to the JS file, the call of the data is JSO n Format data, the disadvantage is that the data is read out at once, the efficiency will be poor, plug-ins to support a number of par
Thanks to the tools that my colleagues can select on the loading date, after the [jquery initial experiences], I naturally thought of a bunch of jquery plug-ins.
Jquery datepicker is better-known than others. However, it seems that he has a huge function, but it is impossible to see clearly the file, style also needs to generate CSS downloading through the feat
Jquery plugin jTimer (jquery timer) Usage
In many cases, we need to execute a task at intervals and stop it when certain conditions are met. This plug-in is designed to solve this common problem.
The Code is as follows:
(Function ($ ){
$. Extend ({
Timer: function (action, context, time ){
Var _ timer;
If ($. isFunction (action )){
(Function (){
_ Timer = setI
in some menu div-defined tags, just like the following:
To create a menu, you should run the following jquery code:
jquery jquery.easyui.min.js Plugin Download
Http://down.111cn.net/down/code/jquery/2010/1023/21385.html
has not changed } } Catch(e) {}}); } initajaxdata (); Findcurrentnum (); } //Find the current page functionFindcurrentnum () {$ This. Find (' a '). each (function () { if(Parseint ($ ( This). HTML ()) = =ops.currentpage) {$ ( This). addclass (' z_paging_current '); } }); Appendele (); } //whether the attached element displays the total number of data functionAppend
There is a multiple choice of requirements, found on the Internet this plugin: MultiSelect
Https://github.com/ehynds/jquery-ui-multiselect-widget
CSDN Blog on the introduction of this plug-in, many children's shoes have asked such a question, how to get the selected value? Really a good question, because I saw the demo when also found the problem, hehe!
Let's talk about this plugin:Jquery-multiselect is b
jquery Plugin Development Tutorials--Raise your level of jquery to a stepThe most successful part of jquery, I think, is that its extensibility has attracted many developers to develop plug-ins to build an ecosystem. This is like the big companies competing to do the platform, the platform to the world. Apple, Microsof
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.