ImageViewer
ImageViewer
The images viewer will generate all HTML and Script code to add an interactive image viewer to your website.
How to Initialize the viewer ?
The initialization of the viewer is an one step process, just call the function Init of the class with his three arguments (see above for more details).*
Class Details
Functions:
Name |
Arguments |
Return |
Description |
Init |
|
VOID |
This function Initialized every part of the viewer: HMTL, CSS, Data, Events, etc... It will be generated in the defined ID as NewID and all HTML IDs used for this viewer will start by the name defined in arguments Also to define the data and the design you must you the data arguments, that work thanks to a JSON files (for more details about the JSON check the section below). |
Private Details
All private details are usable but its recommended to not use anythings of those. It might modify the good working of the class
Variables (Members):
Name |
Type |
Default Value |
Description |
basedId |
String |
null |
HTML Id of the viewer parent. |
data |
JSON |
null |
Data used to initialize the viewer. |
id |
String |
null |
Global HMTL Id of the viewer (# + name). |
listPosition |
Small Class |
|
Hold the details need for the image list movements. |
name |
String |
null |
Name of the viewer used by the class for all HTML IDs |
selectedImgPos |
Integer |
0 |
ID of the selected (active image). |
topButtons |
|
|
This member keep the default direction of the top buttons of the viewer. |
topButtons |
|
|
This member keep the default direction of the top buttons of the viewer. |
Functions:
Name |
Arguments |
Return |
Description |
GetImageId |
|
String - HTML ID of the button |
Function used to get the ID of the images (used to short the code) |
GetImgNumFromId |
|
Integer - ID of the button |
Convert an HTML ID into an Integer ID of a button |
ImagesMouseEnter (Event Function) |
|
VOID |
Event function called when mouse enter on one of the image in the list. It will change his design (css). |
ImagesMouseLeave (Event Function) |
|
VOID |
Event function called when mouse leave on one of the image in the list. It will reset his design (css). |
ImagesMouseUp (Event Function) |
|
VOID |
Event function called when the mouse is released on one of the image in the list. It will remove to the old active image the borders, and set active the selected image. |
InitButtonEvents |
|
VOID |
Initiate buttons event and define the callback function |
isOK |
|
Boolean |
Check if the selected OBJ is valid (Defined // Non-Null) |
MoveImageList (Event Funciton) |
|
VOID |
Function that handle the moving and all calculation for the animation. |
MovingList |
|
VOID |
Function used by the animation process, to move the list. (EaseInOut Animation) |
SwitchImg (Event Function) |
|
VOID |
Function called when top buttons are pressed. It will change the selected image as a click |
TopImageClick (Event Function) |
|
VOID |
Function called when the user pressed the main image. It will zoom in. |
Data Structure
Main Structure Details
"ENTER_NAME": { //Class that hold the whole data
"Global": { //Section Where we define the design
"CSSGroup": { //CSS of the viewer
"CSS": { //CSS
},
"Children": [ //To add extra CSS for some children (see below how it work)
]
},
"Buttons": { //Modify buttons
"TopButtons": { //Modify top buttons
"CSS": { //CSS Details
},
"Normal": null, //Link to the button design for customization - Normal Version (null will take the ones by default)
"Hovered": null, //Link to the button design for customization - Hover Version (null will take the ones by default)
"Pressed": null //Link to the button design for customization - Pressed Version (null will take the ones by default)
},
"BottomButtons": { //Modify Bottom buttons
"CSS": { //CSS Details
},
"Normal": null, //Link to the button design for customization - Normal Version (null will take the ones by default)
"Hovered": null, //Link to the button design for customization - Hover Version (null will take the ones by default)
"Pressed": null //Link to the button design for customization - Pressed Version (null will take the ones by default)
}
}
},
"Images": [ //List of images you want to add into the viewer
]
}
Note:
- CSS Children: Children is a list of class composed by two data (Name are important):
- String: ID - HTML ID of the target (it start by adding the ID of the target object then the children)
- Class: CSS - CSS details to add
Download Sample:
SAMPLE: Here
Created with the Personal Edition of HelpNDoc: Free Qt Help documentation generator