The jQuery plug in supports multiple calls to the same page

  • 2020-12-19 20:54:48
  • OfStack

Update 1.2 removes console output debugging of the callback function, as no console under IE6 would cause plug-in errors, completing the build functionality. Prompt message button support multiple, this version is the latest stable version.

More detailed data writing format, html when build, and options parameters will be provided in the near future. A case study of the switch of supplementary content types.

Introduction:

jquery imageShown plug-in can complete various forms of content wheel display switch. Although all the Demo Provided by me are navigation wheel display pictures, it can also complete the content switch, that is, it can complete Tab function, simple image wheel display function and news information wheel display function. This means that the plugin can display any form of content with reasonable parameters.

This plug-in can display navigation in the top, bottom, left and right directions, background slide animation can be set independently, play area animation can be set independently, the number of navigation in each display area can be set independently, if the setting is wrong or incorrect, it will be reset internally by the plug-in. Whether the prompt message is displayed or not, and the display animation can be set independently. Please refer to Demo for details.

Note: When using the Tab feature, pContent needs to be set to content and since the display area has been fixed in size, please handle content of unknown size in the callback function.

The plugin has internally determined whether the requested resource exists. For example, if an error occurs, you can directly display the default display information provided in the parameter, and you can also handle the error area in the callback function. The callback function allows you to receive the returned arguments.

Description of return parameters:


id // The current Dom the ID , is not set on your page ID In this case ID Will be the only plug-in generated automatically 1 Value.  
total // The number of wheel displays  
/* 
 The current selected number 1 A content area when you loop Set to false This content is the page Dom In the index Value, when loop for true When the navigation area needs according to  attr('data-index') To get the current index . player Area is not affected by loop Limits are always for the current content index value  
*/ 
selected 
curNav// Current navigation, can pass  attr('data-missing') To verify that the content is loading properly.  
curPlay// The main content currently displayed can be passed  attr('data-missing') To verify that the content is loading properly.  
curData// You pass in data data The current value of.  

Development plan for the next step:

When you are unwilling or unable to use the data parameter, you can write the content you want to display to the html page in a fixed format, and then use the build command to leave the rest to the plug-in

Such as:


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

Provides an external pause and restart autoplay interface that you can use in callbacks. More instructions and examples are provided.

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'

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 functionality is complete, more reliable parameters and configuration instructions will be provided.

At the same time, buid will be released as an extension, which means additional files will need to be introduced when build functionality is needed. The purpose of this is to solve the file size problem.

The plugin has been subjected to a lot of abuse and no problem has been found for the time being. The performance of the plugin has been handled very well and the memory leak has not been found after testing. Test platform: ie6, firefox3.6, windows2003

This is the full description of the jQuery plug-in that this site has introduced to support multiple calls to the same page.


Related articles: