ui/ EyeCandy.js

Transition and fading library.  You know... eyecandy :) Coded by Travis Beckham http://www.squidfingers.com | http://www.podlob.com If want to use this code, feel free to do so, but please leave this message intact.  If you do remove this, I will hunt you down :) Several functions added or modified by Scott Upton, Uptonic.com

Copyright

Travis Beckham

Summary
Transition and fading library.
the library version
Finds the current X position of the passed in object
Finds the current Y position of the passed in object
t b c d
t b c d
t b c d
t b c d
t b c d
Constructor.
name
obj name
obj
width of the window
height of the window
top scroll position of the window
left scroll position of the window
set the vertical scroll position of the window
set the horizontal scroll position of the window
set the x,y scroll position of the window
HTMLobj Constructor
left position of the element
top position of the element
width of the element
height of the element
clip width of the element
clip height of the element
change the value of any css property
show the visibility of the element
hide the visibility of the element
toggle the visibility of the element
change the contents of the element
move the element to a new position
move the element to a new position relative to it’s current position
set the size of the element
set the size of the element relative to it’s current size
ease-out animation, callback function optional
cancel the glideTo method
swap the z-index of 2 elements
time-based animation, with multiple easing methods Modified by SU, Uptonic.com
cancel the tweenTo method
generate new random number Added by SU, Uptonic.com December 2004
set opacity of the element
gradually decrease the opacity of the element
gradually increase the opacity of the element
display the element as ‘block’
do not display the element
set the element’s source to target
set the element’s link to target
set the element’s inner HTML to content

Variables

EYECANDY_VERSION

var EYECANDY_VERSION

the library version

Functions

findPosX

function findPosX(obj)

Finds the current X position of the passed in object

From

http://blog.firetree.net- /2005- /07- /04- /javascript-find-position- /

Parameters

obja proper html item, div for example

Returns

the x position on screen

findPosY

function findPosY(obj)

Finds the current Y position of the passed in object

From

http://blog.firetree.net- /2005- /07- /04- /javascript-find-position- /

Parameters

obja proper html item, div for example

Returns

the y position on screen

linearTween

function linearTween(t,
b,
c,
d)
Easing Equations by Robert Pennerrobertpenner.com -

Parameters

t b c d

easeInQuad

function easeInQuad(t,
b,
c,
d)

Parameters

t b c d

easeOutQuad

function easeOutQuad(t,
b,
c,
d)

Parameters

t b c d

easeInOutQuad

function easeInOutQuad(t,
b,
c,
d)

Parameters

t b c d

easeInExpo

function easeInExpo(t,
b,
c,
d)

Parameters

t b c d

easeOutExpo

function easeOutExpo(t,
b,
c,
d)

Parameters

t b c d

Detect

Constructor.  This is another way to detect the browser version and abilites.  This is more DHTML and graphics focused than browsersniffer.js

Summary
name
obj name
obj
width of the window
height of the window
top scroll position of the window
left scroll position of the window
set the vertical scroll position of the window
set the horizontal scroll position of the window
set the x,y scroll position of the window

Functions

Detect. getObj

Parameters

name

Detect. getObjNS4

Parameters

obj name

Detect. getStyle

Parameters

obj

Detect. getWindowWidth

width of the window

Detect. getWindowHeight

height of the window

Detect. getScrollTop

top scroll position of the window

Detect. getScrollLeft

left scroll position of the window

Detect. setScrollTop

set the vertical scroll position of the window

Parameters

n

Detect. setScrollLeft

set the horizontal scroll position of the window

Parameters

n

Detect. setScroll

set the x,y scroll position of the window

Parameters

x y

HTMLobj

HTMLobj Constructor

Extends: Detect

Summary
left position of the element
top position of the element
width of the element
height of the element
clip width of the element
clip height of the element
change the value of any css property
show the visibility of the element
hide the visibility of the element
toggle the visibility of the element
change the contents of the element
move the element to a new position
move the element to a new position relative to it’s current position
set the size of the element
set the size of the element relative to it’s current size
ease-out animation, callback function optional
cancel the glideTo method
swap the z-index of 2 elements
time-based animation, with multiple easing methods Modified by SU, Uptonic.com
cancel the tweenTo method
generate new random number Added by SU, Uptonic.com December 2004
set opacity of the element
gradually decrease the opacity of the element
gradually increase the opacity of the element
display the element as ‘block’
do not display the element
set the element’s source to target
set the element’s link to target
set the element’s inner HTML to content

Functions

HTMLobj. getLeft

left position of the element

HTMLobj. getTop

top position of the element

HTMLobj. getWidth

width of the element

HTMLobj. getHeight

height of the element

HTMLobj. getClipWidth

clip width of the element

HTMLobj. getClipHeight

clip height of the element

HTMLobj. setStyle

change the value of any css property

Parameter

prop val

HTMLobj.show

show the visibility of the element

HTMLobj.hide

hide the visibility of the element

HTMLobj. showhide

toggle the visibility of the element

HTMLobj. setInner

change the contents of the element

Paramerter

html

HTMLobj. moveTo

move the element to a new position

Parameters

x y

HTMLobj. moveBy

move the element to a new position relative to it’s current position

Parameters

x y

HTMLobj. sizeTo

set the size of the element

Parameters

w h

HTMLobj. sizeBy

set the size of the element relative to it’s current size

Parameters

wthe width
hthe height

HTMLobj. glideTo

ease-out animation, callback function optional

Parameters

x y callback

HTMLobj. cancelGlide

cancel the glideTo method

HTMLobj. swapDepth

swap the z-index of 2 elements

Parameters

obj

HTMLobj. tweenTo

time-based animation, with multiple easing methods Modified by SU, Uptonic.com

Parameters

methoda function that takes 4 arguments: time, start, change, and duration
startarray of starting width, height dimensions [w, h]
endarray of ending width, height dimensions [w, h]
timenumber of ‘frames’ it takes to get to the end position

HTMLobj. cancelTween

cancel the tweenTo method

HTMLobj. getRandom

generate new random number Added by SU, Uptonic.com December 2004

HTMLobj. setOpacity

set opacity of the element

HTMLobj. fadeOut

gradually decrease the opacity of the element

Parameters

opacitystarting opacity of element
changethe size of the increments between steps
speedthe rate of the animation

HTMLobj. fadeIn

gradually increase the opacity of the element

Parameters

opacitystarting opacity of element
changethe size of the increments between steps
speedthe rate of the animation

HTMLobj. displayShow

display the element as ‘block’

HTMLobj. displayHide

do not display the element

HTMLobj. setSrc

set the element’s source to target

Parameters

target

HTMLobj. setHref

set the element’s link to target

Parameters

target

HTMLobj. setInnerHtml

set the element’s inner HTML to content

Parameters

content

var EYECANDY_VERSION
the library version
function findPosX(obj)
Finds the current X position of the passed in object
function findPosY(obj)
Finds the current Y position of the passed in object
function linearTween(t,
b,
c,
d)
function easeInQuad(t,
b,
c,
d)
t b c d
function easeOutQuad(t,
b,
c,
d)
t b c d
function easeInOutQuad(t,
b,
c,
d)
t b c d
function easeInExpo(t,
b,
c,
d)
t b c d
function easeOutExpo(t,
b,
c,
d)
t b c d
Constructor.