The jquery plugin supports multiple calls to the same page _jquery

Source: Internet
Author: User

Update version 1.2 the console output debugging of the delete callback function, because there is no console in the IE6 can cause a plug-in error, complete the build function. The prompt Information button supports multiple, this version is the latest stable version.

A more detailed description of the data writing format will be provided in the near future, HTML format description at build time, and detailed options parameter descriptions. A toggle display case for a supplemental content type.

Introduction:

jquery Imageshown Plug-ins can be completed in a variety of forms of content wheel display switch, all I provide in the demo although are guided by the wheel display picture, but it can also complete the content of the switch, that is, you can complete the tab function, simple picture wheel display function, news information of the wheel. This means that the plug-in can display any form of content with reasonable parameters.

This plug-in can be in the top and bottom four directions display navigation, background sliding animation can be set independently, play area animation can be set independently, each time to enter the display area navigation number can be set independently, if set wrong or unreasonable settings will be the plug-in internal reset. The hint information is displayed, and the display animation can be set independently. Please refer to the relevant content of the demo.

Note: When you use the tab feature, you need to set pcontent to content and because the display area is already fixed size, please handle the unknown size in the callback function.

The inside of the plug-in has been judged on the existence of the requested resource, such as an error you can display the default display information directly in the parameters, and you can also handle the error area in the callback function. callback function you can take back the transmitted parameters.

Description of the postback parameter:

ID//Current DOM ID, which is the only value that the plug-in automatically generates if your page does not have an ID set. 
Total//number of display content//The 
first content area currently selected, when you set the loop to false this is the index value in the page DOM, and when the loop is true the navigation area needs to be based on the attr (' Data-index ') to get the current index. The player area is not restricted by the loop, always the current content's index value 
/Selected curnav//currently navigation, can be attr (' data-missing ') to confirm the normal loading of the content. 
curplay//The main content currently displayed, you can verify that the content is loading normally by attr (' data-missing '). 

Next Development plan:

When you don't want to or don't use the data parameter, you can say what you need to display to write the HTML page in a fixed format, and then use the build command to complete the rest with the plugin.

For example:

$ (' Elem '). Imageshown (' bulid '); 
$ (' Elem '). Imageshown (' Bulid ', {' options '}); 

Provides an external pause and restart AutoPlay interface that you can use in a callback function. Provide more instructions and examples.

Default parameters:

Id:null,
Navspace:47,
pwidth:0,
pheight:0,
Navnum:4,
Navplace:null,
Autoplay:true,
autotime:4000,
Events: ' MouseEnter ',
Tbganimate:true,
Tbgspeed: ' Fast ',
Addtional:false,
Step:1,
Scrollspeed: ' Fast ',
opacity:0.6,
Data:null,
Loop:true,
Player:true,
Animate: ' fade ',//left,right,top,bottom,fade,none
Deepnav:false,
Showtips:true,
Tipsanimate: ' fade ',//fade,slide
Selected:1,
Callback:null,
Preload:true,
Target: ' _blank ',
PSPEED:500,
Ptype:false,
Tcontent: ' Image ',//num,none,image,content
Listplace:null,
Tipsbtn:false,
LoadClass: ' Img-player-loading ',
Pcontent: ' Image '

How to use:

 
 

Setter:

$ (' Elem '). Imageshown (' option ', {' options '}); 

Getter

 
 

After the build feature is complete, more trusted parameters and instructions for configuration are provided.

At the same time, BUiD will be published in an expanded form, that is, when you need to use the build feature, you need to introduce additional files. This is done to solve the file size problem.

Plugin after a lot of tyranny temporarily did not find the problem, the performance has been handled very well, after testing has not found a memory leak problem. Test platform: ie6,firefox3.6, Windows2003

The above is a small series to introduce the jquery plug-ins to support the same page has been repeatedly called all the narrative, I hope to help you.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.