BIND (2) 썸네일형 리스트형 jQuery, live 죽이는 die 와 bind 죽이는 unbind 그리고 on 과 off jQuery 도 버전이 상당히 많이 나왔지요. 버전에 따라 Deprecated 되는 함수들이나 사용방법들이 생겨나고 있기 때문에 차이점을 인지하고 있어야 하겠네요. http://findfun.tistory.com/entry/jQuery-API-%EC%A0%95%EB%B3%B5-die-%EC%9D%B4%EB%B2%A4%ED%8A%B8-%ED%95%B4%EC%A0%9C%ED%95%98%EA%B8%B0 http://api.jquery.com/die/ jQuery, each, click, toggle 을 몽땅 사용해서.. $('..').each(function(){ $(this).click(function(){ $(this).toggle(function(){ $(this).css('background-color','#9678bf'); }); }); }); $('..').bind('click',function(){ $(this).toggle(function(){ $(this).css('background-color','#9678bf'); }); }); $('..').each(function(index){ // 여기서 index 는 each 에 잡히는 개체의 순서. 0, 1, 2, ... }); cf. jquery index 클릭해 보세요.. 이전 1 다음