/**
* Move element to vertical point.
*
* @param object element
* @param int yPoint
*/
function js_move_elementToYPos(element, yPoint){
element.style.position = 'absolute';
element.style.top = yPoint;
}
PHP + Javascript Snippets
PHP and javascript snippets you can copy and paste.
Friday, June 8, 2007
js_move_elementToXPos(element, xPoint)
/**
* Move element to horizontal point.
*
* @param object element
* @param int xPoint
*/
function js_move_elementToXPos(element, xPoint){
element.style.position = 'absolute';
element.style.left = xPoint;
}
* Move element to horizontal point.
*
* @param object element
* @param int xPoint
*/
function js_move_elementToXPos(element, xPoint){
element.style.position = 'absolute';
element.style.left = xPoint;
}
Thursday, June 7, 2007
js_move_elementHorizontal(element, shiftHoriz)
/**
* Move element horizontally.
*
* @param object element
* @param int shiftHorizontal
*/
function js_move_elementHorizontal(element, shiftHoriz){
element.style.position = 'relative';
element.style.left = shiftHoriz;
}
* Move element horizontally.
*
* @param object element
* @param int shiftHorizontal
*/
function js_move_elementHorizontal(element, shiftHoriz){
element.style.position = 'relative';
element.style.left = shiftHoriz;
}
js_move_elementVertical(element, shiftVertical)
/**
* Move element vertically.
*
* @param object element
* @param int shiftVertical
*/
function js_move_elementVertical(element, shiftVertical){
element.style.position = 'relative';
element.style.top = shiftVertical;
}
* Move element vertically.
*
* @param object element
* @param int shiftVertical
*/
function js_move_elementVertical(element, shiftVertical){
element.style.position = 'relative';
element.style.top = shiftVertical;
}
js_get_rand(max)
/**
* Gets a random number
*
* @param int max
* @return int
*/
function js_get_rand(max){
return Math.random()*max;
}
* Gets a random number
*
* @param int max
* @return int
*/
function js_get_rand(max){
return Math.random()*max;
}
js_get_isEven(n)
/**
* Gets whether a number is even
*
* @param int n
* @return int
*/
function js_get_is_even(n){
return n % 2 == 0?true:false;
}
* Gets whether a number is even
*
* @param int n
* @return int
*/
function js_get_is_even(n){
return n % 2 == 0?true:false;
}
js_is_odd(n)
/**
* Gets whether a number is odd.
*
* @param int n
* @return int
*/
function is_odd(n){
return n % 2 == 0?false:true;
}
* Gets whether a number is odd.
*
* @param int n
* @return int
*/
function is_odd(n){
return n % 2 == 0?false:true;
}
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2007
(71)
-
▼
June
(20)
- js_move_elementToYPos(element, yPoint)
- js_move_elementToXPos(element, xPoint)
- js_move_elementHorizontal(element, shiftHoriz)
- js_move_elementVertical(element, shiftVertical)
- js_get_rand(max)
- js_get_isEven(n)
- js_is_odd(n)
- js_get_screenCenterY()
- js_get_screenCenterX()
- js_get_elementTop()
- js_get_elementLeft()
- js_get_elementHeight()
- js_get_elementWidth
- js_get_pageWidth()
- js_get_pageHeight()
- js_get_scrollTop()
- js_get_scrollLeft()
- js_get_browserInnerHeight
- js_get_browserInnerWidth
- js_get_pageInnerWidth
-
▼
June
(20)