전체 글 (127) 썸네일형 리스트형 [jQery] addclass / removeclass addclass $("#box").addClass("box_active"); $(this).addClass("box_active"); 클래스를 추가한다. removeclass $("#box").removeClass("box_active"); $(this).removeClass("box_active"); 클래스를 제거한다. [jQuery] on 이벤트 (touchstart, touchend) touchstart $("#box").on('touchstart', function(e) { console.log("touchstart"); }); 터치 시작 할때 이벤트 touchend $("#box").on('touchend', function(e) { console.log("touchend"); }); 터치 끝날 때 이벤트 bind 와 on 이벤트의 차이는 없지만 on을 권장한다고 한다. [Javascript] touchstart / touchend touchstart document.getElementById("myP").addEventListener("touchstart", myFunction); function myFunction() { document.getElementById("demo").innerHTML = "Hello World"; } document.getElementById("myP").ontouchend = myFunction; function myFunction() { document.getElementById("demo").innerHTML = "Hello World"; } touchend document.getElementById("myP").addEventListener("touchend", myFunction); func.. 이전 1 ··· 25 26 27 28 29 30 31 ··· 43 다음