Onload 이벤트 2009-07-14 07:16:19에 작성. 922번 읽힘.

페이지 로딩시에 <body onload=”">를 쓰는 경우가 많이 있습니다.

이를 js 로 표현이 가능합니다. 방법에는 두가지가 있습니다.

첫번째 방법

window.onload = function(){ alert('hi'); }

이 방법은 <body onload=”">가 있으면 실행되지 않습니다.

두번째 방법

function window::onload(){ alert('hi'); }

이 방법은 <body onload=”">후에 실행 됩니다. 구글 크롬에서 작동이 되지 않습니다.

CSS <-> Javascript 속성 레퍼런스 2009-07-14 06:21:37에 작성. 382번 읽힘.

CSS Properties To JavaScript Reference Conversion

CSS Property JavaScript Reference
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
clip clip
color color
cursor cursor
display display
filter filter
font font
font-family fontFamily
font-size fontSize
font-variant fontVariant
font-weight fontWeight
height height
left left
letter-spacing letterSpacing
line-height lineHeight
list-style listStyle
list-style-image listStyleImage
list-style-position listStylePosition
list-style-type listStyleType
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
overflow overflow
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
page-break-after pageBreakAfter
page-break-before pageBreakBefore
position position
float styleFloat
text-align textAlign
text-decoration textDecoration
text-decoration: blink textDecorationBlink
text-decoration: line-through textDecorationLineThrough
text-decoration: none textDecorationNone
text-decoration: overline textDecorationOverline
text-decoration: underline textDecorationUnderline
text-indent textIndent
text-transform textTransform
top top
vertical-align verticalAlign
visibility visibility
width width
z-index zIndex

Usage

Internet Explorer

document.all.div_id.style.JS_property_reference = “new_CSS_property_value”;

Older Netscape’s (4.7 and earlier)

document.div_id.JS_property_reference = “new_CSS_property_value”;

Netscape 6.0+ and Opera (and other Mozilla)

document.getElementById(div_id).style.JS_property_reference = “new_CSS_property_value”;

Note the use of parentheses instead of square brackets in newer Mozilla’s “getElementById()” reference.

출저: http://codepunk.hardwar.org.uk/css2js.htm

이 포스트와 비슷한 포스트들