괴발개발/Javascript+JQuery 75

JQ_propagation(stopPropagation)

- propagation : 요소에 이벤트가 실행되면 해당 요소에만 이벤트가 실행되는 것이 아니라 조상 요소들에도 이벤트가 실행되는 것 - stopPropagation() : 요소에 이벤트가 실행됐을 때, 조상 요소들에 이벤트가 실행되는 것을 막아주는 메소드 - 자식요소와 부모(조상) 요소에서 같은 요소를 가지고 작업을 하는 경우, stopPropagation()을 사용 box1 box2 box3

JQ_롤링기능(rolling_가로,세로,역방향)

rolling.js => 롤링기능 모아놓은 파일 function rollingTop(list, listItem, marginTop, animateTime, intervalTime){ var id = setInterval(function(){ if(!$(list + ' ' + listItem).first().is(':animated')){ //가아니면 $(list + ' ' + listItem).first() .animate({'margin-top':marginTop+'px'},animateTime,function(){ $(this).detach().appendTo(list).removeAttr('style'); }) } },intervalTime) return id; } function rollingLe..

JQ_detach()

- detach() : 요소를 뗀다(속성과 이벤트 정보를 유지) - 요소를 떼기만하면 제거랑 같은기능(remove) - 보통은 요소를 떼서 다른 곳에 붙일 때 사용 - is('') : ~인지 아닌지 확인하여 ~이면 true, 아니면 false 반환 - :animated, : checked, :eq(1) 을 보통 함께 사용해서 같이쓰는 것들의 상태를 확인 - 마우스를 요소 위에 댔을 때와 벗어났을 때 같은 함수를 실행 hover(function(){ }) - 마우스를 요소 위에 댔을 때와 벗어났을 때 다른 함수를 실행 hover(function(){ //마우스를 요소 위에 댔을 때 }, function(){ }) //마우스가 요소 위에서 벗어났을 때 - removeAttr('속성명'): 해당 속성값을 삭제..