ex1 :
$(".str_submenu > ul > li > ul.sub-menu > li").each(function(){
if($(this).hasClass("active")===true){
//$(this).parent().css('display','block');
}
});
ex2-1 :
jQuery('li.amazingcarousel-item').each(function(index) {
jQuery(this).hover(
function() {
jQuery(this).find('img').attr("src", jQuery(this).find('img').attr("src").replace("gray.jpg", "on.jpg"));
},
function() {
jQuery(this).find('img').attr("src", jQuery(this).find('img').attr("src").replace("on.jpg", "gray.jpg"));
}
);
});
ex2-2 :
jQuery('li.amazingcarousel-item').each(function(){
jQuery(this).find('img').hover(
function() {
jQuery(this).attr("src", jQuery(this).attr("src").replace("gray.jpg", "on.jpg"));
},
function() {
jQuery(this).attr("src", jQuery(this).attr("src").replace("on.jpg", "gray.jpg"));
}
);
});
'jQuery' 카테고리의 다른 글
[jQuery] Request Parameter 받기 (0) | 2018.01.10 |
---|---|
[javascript] http와 https 구분없이(혹은 구분해서) 페이지 로딩 (0) | 2017.12.20 |
[jQuery] 텍스트/문자열 변경 및 검색 - indexOf, match 함수, replace 함수, split 함수, html(),text(),val() 메소드 (0) | 2017.12.19 |
[jQuery] 페이지 링크값 변경 - prop() 메소드, removeAttr 메소드 (0) | 2017.12.19 |
[jQuery] 화면 상단 스크롤 - animate(scrollTop:0) (0) | 2017.12.19 |