The jQuery plug-in supports multiple calls to the same page.

Source: Internet
Author: User
This article mainly introduces the information related to jQuery plug-in supporting multiple calls to the same page. If you need it, refer to the console output debugging of the callback function updated in version 1.2, this is because no console in IE6 will cause a plug-in error and complete the build function. Multiple prompt buttons are supported. This version is the latest stable version.

In the near future, we will provide more detailed data writing format descriptions, html format descriptions during build, and detailed options parameter descriptions. Shows the case of switching the supplemental content type.

Introduction:

The jquery imageShown plug-in can complete multiple forms of content wheel-show switching. Although all the demos I provide are navigation-Driven Wheel-show images, it can also switch content, that is, you can complete the Tab function, the simple image rotation function, and the rotation of news information. That is to say, this plug-in can display any form of content with the combination of reasonable parameters.

This plug-in can display navigation in the upper, lower, and left directions. The background slide animation can be set independently, the playback area animation can be set independently, and the number of navigation entries in the display area can be set independently each time, if the setting is incorrect or the setting is unreasonable, it will be reset inside the plug-in. Whether the prompt information is displayed, and whether the display animation can be set independently. For details, refer to the Demo content.

Note: when using the Tab function, you need to set pContent to content. Because the display area has been fixed, you must process the unknown content in the callback function.

The plug-in has made a judgment on whether the requested resource exists. For example, if an error occurs, you can directly display the default display information in the parameter, you can also handle this error area in the callback function. The callback function allows you to receive callback parameters.

Description of return parameters:

Id // the ID of the current Dom. If no ID is set on your page, this ID will be the unique value automatically generated by the plug-in. Total // Number of displayed content/* The first selected content area. When your loop is set to false, this content is the index value in the Dom of the page, when the loop is true, the navigation area needs to obtain the current index based on attr ('data-Index. The player region is not restricted by loop. It is always the index value of the current content */selected curNav // The current navigation. You can use attr ('data-missing') to check whether the content is loaded normally. CurPlay // The main content currently displayed. You can use attr ('data-missing') to check whether the content is loaded normally. CurData // the current value of your incoming data.

Next Development Plan:

If you do not want to or do not want to use the data parameter, you can write the content to be displayed to the html page in a fixed format, and then use the build command to complete the remaining content by the plug-in.

For example:

$('elem').imageShown('bulid'); $('elem').imageShown('bulid',{'options'}); $('elem').imageShown('bulid','option','value'); 

It provides an interface for you to pause and restart automatic playback, so that you can use it in the callback function. Provides 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: 'quick ',
Addtional: false,
Step: 1,
ScrollSpeed: 'quick ',
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'

Usage:

$('elem').imageShown({'options'}); 

Setter:

$('elem').imageShown('option',{'options'}); $('elem').imageShown('option','option','value'); 

Getter

var option = $('elem').imageShown('option','option name'); 

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

At the same time, the buid will be released in an extended form, that is, when you need to use the build function, you need to introduce another file. This aims to solve the file size problem.

The plug-in has not encountered any problems after a lot of abuse, and the performance has been well handled. No Memory leakage problems have been found during tests. Test platforms: ie6, firefox3.6, and windows2003

The above is a description of the jQuery plug-in introduced by the small editor that supports multiple calls to the same page. I hope it will help you.

Related Article

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.