Dev/jQuery
[jQuery] 이미지 버튼 변하게(마우스오버/마우스아웃) 만들기
쇼크리더
2009. 12. 11. 17:43
반응형
짐 까지 공부한것 중에 많은 고민 안하고 2가지 정도로 만들어 보았다.
뭐.. 별거 없다.
방법 1. mouseover 와 mouseout으로 따로 구현(주석처리한 라인)
방법 2. hover를 이용하여 구현.
더 찾아보면 방법은 많겠지만 난 이것만으로도 만족만족.
뭐.. 별거 없다.
$(document).ready(function () { // $('#imgNext').mouseover(function () { // $(this).attr({ // 'src': 'Images/btn_before.gif' // }); // }); // $('#imgNext').mouseout(function () { // $(this).attr({ // 'src': 'Images/btn_next.gif' // }); // }); $('#imgNext').hover(function () { $(this).attr({ 'src': 'Images/btn_before.gif' }); }, function () { $(this).attr({ 'src': 'Images/btn_next.gif' }); }); });
방법 1. mouseover 와 mouseout으로 따로 구현(주석처리한 라인)
방법 2. hover를 이용하여 구현.
더 찾아보면 방법은 많겠지만 난 이것만으로도 만족만족.
반응형