Namespace aV.Visual
Represents a namespace, aV.Visual, for the new functions and global parameters of those functions.
Defined in: aV.main.visual.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Represents a namespace, aV.Visual, for the new functions and global parameters of those functions.
|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
aV.Visual.customHint
|
| <static> |
aV.Visual.fixedElements
Holds the fixed elements recognized by the initEditables function.
|
| <static> |
aV.Visual.infoBox
|
| <static> |
aV.Visual.initFunctions
Holds the user defined initialization functions.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
aV.Visual.clientHeight()
Returns the internal usable height of the page.
|
| <static> |
aV.Visual.clientWidth()
Returns the internal usable width of the page.
|
| <static> |
aV.Visual.fade(obj, opacity, callback)
Fades the given HTML element, to the given opacity value with a slowing fade effect.
|
| <static> |
aV.Visual.fadeFromOneToOne(fromObj, toObj, callback)
Fades the first element to invisiblity and then fades the second element to full opacity.
|
| <static> |
aV.Visual.fadeNSlide(obj, newDimension, opcDirection, horizontalSlide, callback)
Slides the given HTML element to the given dimension with a combined fade efect.
|
| <static> |
aV.Visual.getCSSRule(ruleName, deleteFlag)
Gets the CSS rule element whose name is given with ruleName parameter or deletes it providing to the deleteFlag's state.
|
| <static> |
aV.Visual.getElementPositionX(element)
Gets the x position of the element.
|
| <static> |
aV.Visual.getElementPositionY(element)
Gets the y position of the element.
|
| <static> |
aV.Visual.getOpacity(obj)
Tries to get the given element's opacity value.
|
| <static> |
aV.Visual.init()
Initializes the aV.Visual system.
|
| <static> |
aV.Visual.initFixedElements()
This function initialises the "fixed positioned elements" and adds them to the fixedElements array.
|
| <static> |
aV.Visual.move(obj, xPos, yPos, callback)
Moves the given object to the given postion with a slowing move effect.
|
| <static> |
aV.Visual.scrollLeft()
Returns the scroll offset of the page from the left.
|
| <static> |
aV.Visual.scrollTop()
Returns the scroll offset of the page from the top.
|
| <static> |
aV.Visual.setFixedElementPositions()
This function is called whenever a scroll or resize event is occured.
|
| <static> |
aV.Visual.setOpacity(obj, opacity)
Sets the given element's opacity to the given opacity value.
|
Namespace Detail
aV.Visual
Represents a namespace, aV.Visual, for the new functions and global parameters of those functions.
- Parameters:
- {Integer} config.slideTreshold
- The maximum dimension difference between the current dimension and the target dimension to stop the sliding.
- {Float} config.slideDivisor
- The slide functions divide the remaining dimension difference to this number and add the result to the current dimension. The bigger this number gets the slower the slide gets.
- {Float [0|1]} config.fadeTreshold
- The maximum opacity difference between the current opacity and the target opacity to stop the fade.
- {Float} config.fadeDivisor
- The fade functions divide the remaining opacity difference to this number and add the result to the current opacity. The bigger this number gets the slower the fade gets.
- Requires:
- (aV.main.events.js)
Field Detail
<static>
{HTMLDivElementObject}
aV.Visual.customHint
Defined in: aV.plg.customHint.js.
<static>
{HTMLElementObject[]}
aV.Visual.fixedElements
Holds the fixed elements recognized by the initEditables function.
Changing this properties value is not recommended.
<static>
{HTMLDivElementObject}
aV.Visual.infoBox
Defined in: aV.plg.infoBox.js.
<static>
{Function[]}
aV.Visual.initFunctions
Holds the user defined initialization functions.
Suitable for extending aV.Visual library.
A developer can easly add his/her own function as in the example.
A developer can easly add his/her own function as in the example.
aV.Visual.initFunctions.add(
function()
{
aV.Visual.myPlugin={}
aV.Visual.myPlugin.version="1.0";
aV.Visual.myPlugin.foo=function()
{
alert("I'm a function of aV.Visual.myPlugin!");
}
}
);
Method Detail
<static>
{Integer}
aV.Visual.clientHeight()
Returns the internal usable height of the page.
- Returns:
- {Integer}
<static>
{Integer}
aV.Visual.clientWidth()
Returns the internal usable width of the page.
- Returns:
- {Integer}
<static>
aV.Visual.fade(obj, opacity, callback)
Fades the given HTML element, to the given opacity value with a slowing fade effect.
- Parameters:
- {HTMLElementObject} obj
- The HTML element ITSELF which will be faded. It must have an ID.
- {Float [0|1]} opacity
- The desired/target opacity to be faded to.
- {Function(HTMLElementObject)} callback Optional
- The function which will be called immediately after the fade operation is finished.
<static>
aV.Visual.fadeFromOneToOne(fromObj, toObj, callback)
Fades the first element to invisiblity and then fades the second element to full opacity.
- Parameters:
- {HTMLElementObject} fromObj
- The HTML element which will be FADED OUT.
- {HTMLElementObject} toObj
- The HTML element which will be FADED IN.
- {Function(HTMLElementObject|HTMLElementObject)} callback Optional
- The function which will be called immediately after the whole fade operation is finished. The first parameter passed to the function is fromObj and the second parameter is toObj.
<static>
aV.Visual.fadeNSlide(obj, newDimension, opcDirection, horizontalSlide, callback)
Slides the given HTML element to the given dimension with a combined fade efect. The effects slow down non-linearly.
- Parameters:
- {HTMLElementObject} obj
- The HTML element ITSELF which will be slided. It *MUST* have an ID.
- {Integer} newDimension
- The desired/target height/width to be slided to.
- {Integer [-1|1]} opcDirection
- The opacity change direction identifier. If it is positive the opacity INCREASES with the continuing slide operation and vice versa.
- {Boolean} horizontalSlide
- Defines if the newDimension is a height value or a width value. (Width if true)
- {Function(HTMLElementObject)} callback Optional
- The function which will be called immediately after the slide operation is finished.
<static>
{CSSRuleElementObject}
aV.Visual.getCSSRule(ruleName, deleteFlag)
Gets the CSS rule element whose name is given with ruleName parameter or deletes it providing to the deleteFlag's state.
- Parameters:
- {String} ruleName
- The name of the CSS rule which will be returned.
- {Boolean} deleteFlag Optional
- Set to true if you want to delete the CSS rule whose name is given in the ruleName parameter.
- Returns:
- {CSSRuleElementObject}
<static>
{Integer}
aV.Visual.getElementPositionX(element)
Gets the x position of the element.
- Parameters:
- {HTMLElementObject} element
- The HTML element whose x position to be gathered.
- Returns:
- {Integer}
<static>
{Integer}
aV.Visual.getElementPositionY(element)
Gets the y position of the element.
- Parameters:
- {HTMLElementObject} element
- The HTML element whose y position to be gathered.
- Returns:
- {Integer}
<static>
{Float [0|1]}
aV.Visual.getOpacity(obj)
Tries to get the given element's opacity value.
IMPORTANT: At the moment it can only get the opacity values defined in the object's style property.
IMPORTANT: At the moment it can only get the opacity values defined in the object's style property.
- Parameters:
- {HTMLElementObject} obj
- The HTML element ITSELF whose opacity will tried to be gathered.
- Returns:
- {Float [0|1]} If a valid opacity value cannot be gathered, the default return value is 1.
<static>
aV.Visual.init()
Initializes the aV.Visual system.
Loops through the initFunctions array and calls every function in the array.
After the loop is done, calls initFixedElements.
Attached to the window.onload event automatically.
<static>
aV.Visual.initFixedElements()
This function initialises the "fixed positioned elements" and adds them to the fixedElements array.
It also adds the setFixedElementPositions function to window.onresize and window.onscroll event lists.
The mentioned elements must have their ID properties set.
The so called "fixed positioned elements" are the ones which has an xOffset or a yOffset property(or both of them).
These properties define the elements' distance from the page's edges. A negative offset means the offset is measured from the opposite edge. (i.e. xOffset="-10" means 10 pixels from right side)
It also adds the setFixedElementPositions function to window.onresize and window.onscroll event lists.
The mentioned elements must have their ID properties set.
The so called "fixed positioned elements" are the ones which has an xOffset or a yOffset property(or both of them).
These properties define the elements' distance from the page's edges. A negative offset means the offset is measured from the opposite edge. (i.e. xOffset="-10" means 10 pixels from right side)
<div id="cart" xOffset="-10" yOffset="-10">
I'm your shopping cart and I stay always at the top right corner of your window with a 10px padding
</div>
<static>
aV.Visual.move(obj, xPos, yPos, callback)
Moves the given object to the given postion with a slowing move effect.
- Parameters:
- {HTMLElementObject} obj
- The HTML element which will be moved.
- {Integer | false} xPos Optional
- The target X coordinate of the given HTML element. If it is given as false, the X coordinate is not changed.
- {Integer | false} yPos Optional
- The target Y coordinate of the given HTML element. If it is given as false, the Y coordinate is not changed.
- {Function(HTMLElementObject)} callback Optional
- The function which will be called immediately after the moving operation is finished.
<static>
{Integer}
aV.Visual.scrollLeft()
Returns the scroll offset of the page from the left.
- Returns:
- {Integer}
<static>
{Integer}
aV.Visual.scrollTop()
Returns the scroll offset of the page from the top.
- Returns:
- {Integer}
<static>
aV.Visual.setFixedElementPositions()
This function is called whenever a scroll or resize event is occured. It determines the fixed elements' appropriate new positions and calls "moveElement" to set them.
Can be called manually to ensure all the fixed elements are in correct place.
Can be called manually to ensure all the fixed elements are in correct place.
<static>
aV.Visual.setOpacity(obj, opacity)
Sets the given element's opacity to the given opacity value.
- Parameters:
- {HTMLElementObject} obj
- The HTML element ITSELF whose opacity will be changed.
- {Float [0|1]} opacity
- The opacity value which the object's opacity will be set to.