-이미지일때
<script type="text/javascript">
<!--
$(document).ready(function() {
$(".img_over").mouseover(function (){
var file = $(this).attr('src').split('/');
var filename = file[file.length-1];
var path = '';
for(i=0 ; i < file.length-1 ; i++){
path = ( i == 0 )?path + file[i]:path + '/' + file[i];
}
$(this).attr('src',path+'/'+filename.replace('.jpg','_on.jpg'));
}).mouseout(function(){
var file = $(this).attr('src').split('/');
var filename = file[file.length-1];
var path = '';
for(i=0 ; i < file.length-1 ; i++){
path = ( i == 0 )?path + file[i]:path + '/' + file[i];
}
$(this).attr('src',path+'/'+filename.replace('_on.jpg','.jpg'));
});
});
//-->
</script>
<img src="images/btn_motp_join.jpg" class="img_over" alt="" />
'jquery' 카테고리의 다른 글
| IE6 이 아닐때 액션 (0) | 2012.02.17 |
|---|---|
| 서브메뉴 (0) | 2012.02.17 |
| 퀵메뉴 (0) | 2012.02.17 |
| iframe 내에 있는 id 찾기 (0) | 2012.02.17 |
| 기초문법 퍼옴 (0) | 2012.02.17 |