본문 바로가기
Develop/JavaScript & JQuery

jQuery 이벤트

by jaekk 2018. 6. 10.

 이벤트 연결

  1. 간단한 이벤트

 1) $('선택자').bind(이벤트이름, 함수) 

 $('h1').bind('click',function(){

    $(this).html(function(index, html){

        return html + '+';

    });

 }); 

 

 2) $('선택자').bind(객체)

 $('h1').bind({

    mouseenter: function() {     

        $(this).addClass('reverse'); },

    mouseleave: function(){

        $(this).removeClass('reverse'); }  

 });

 

 3) hover({mouseenter},{mouseleave})

 $('h1').hover(

    { $(this).addClass('reverse'); }

   .{ $(this).removeClass('reverse');}

 );

  4) toggle() 
   


'Develop > JavaScript & JQuery' 카테고리의 다른 글

SELECT BOX(1차)  (0) 2018.06.11
SELECT BOX(2차)  (0) 2018.06.11
JQuery  (0) 2018.06.10
jQuery로 이벤트 다루기(1)  (0) 2018.06.07
카드게임(수정)  (0) 2018.06.04

댓글