반응형
    
    
    
  .css(propertyName,value) - 기본적 형태 css( 속성명 , 속성값)
$(".box").css("width","100px");
.css(propertyName,function(index,value) { })
   - function 사용 자신이 원하는 기능 확장 // index는 선택한 개체 순서, value 는 해당 개체의 현재 속성값
$("#inText").css("color",function(index,value) {
	if(value=="rgb(0, 0, 255)"){ //color 가 rgb(0, 0, 255) 이면 red로 변경
		return "red";
	}
});
.css(map) - 맵형태로 입력 {key:value}
$("#button").bind("mouseover", function() {
	$("#inText").css({
		'background':'cyan',
		'font-weight':'bold',
		'color':'blue'
	});
});
반응형
    
    
    
  '자바스크립트&jQuery' 카테고리의 다른 글
| jQuery preventDefault(); (0) | 2011.10.17 | 
|---|---|
| jQuery hover(), toggleClass(), toggle() (0) | 2011.10.14 | 
| jQuery 마우스 이벤트(클릭한 버튼, 클릭한 위치) event.button, event.screenX, event.screenY (0) | 2011.10.14 | 
| jQuery bind(), unbind(), trigger() (0) | 2011.10.14 | 
| google jQuery 최신 버전 지원(1.버전대) (0) | 2011.10.07 |