j쿼리 질문 있습니다. 저한테는 너무 어렵네요..ㅠㅠ

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
j쿼리 질문 있습니다. 저한테는 너무 어렵네요..ㅠㅠ

QA

j쿼리 질문 있습니다. 저한테는 너무 어렵네요..ㅠㅠ

본문

혹시 아래의 소스를 하고나면... 쇼핑몰 이동시 창을 다른곳으로 이동하면 자동으로 또 열립니다.

다른 창으로 이동하면 다시 튀어 나와서 매번 창을 이동할때마다 닫아도 텨나오고

닫아도 텨나오는데..혹시 한 번 닫으면 다시 열때까지 안튀어 나오게 할 수 있는 방법이나

어디 소스 참고할만한곳 없을까요 ?


//사이드메뉴 열기,닫기
    jQuery(".toggle_bt").on('click',function(){
        if (jQuery(this).attr("data") == "") {
            jQuery(this).attr("data","on");
            imgSrc = jQuery(this).find("img").attr("src");
            jQuery(".fix_rt_menu").stop().animate({right:"0px"},300);
            jQuery(this).find("img").attr("src",imgSrc.replace("_on","_off"));
        } else {
            jQuery(this).attr("data","");
            imgSrc = jQuery(this).find("img").attr("src");
            console.log(imgSrc);
            jQuery(this).find("img").attr("src",imgSrc.replace("_off","_on"));
            jQuery(".fix_rt_menu").stop().animate({right:"-280px"},300);
            
        }
    });

고수님들 미리 감사합니다.

이 질문에 댓글 쓰기 :

답변 1


function toggle_bt_on() {
    jQuery(".toggle_bt").attr("data","on");
    imgSrc = jQuery(".toggle_bt").find("img").attr("src");
    jQuery(".fix_rt_menu").stop().animate({right:"0px"},300);
    jQuery(".toggle_bt").find("img").attr("src",imgSrc.replace("_on","_off"));
}
function toggle_bt_off() {
    jQuery(".toggle_bt").attr("data","");
    imgSrc = jQuery(".toggle_bt").find("img").attr("src");
    console.log(imgSrc);
    jQuery(".toggle_bt").find("img").attr("src",imgSrc.replace("_off","_on"));
    jQuery(".fix_rt_menu").stop().animate({right:"-280px"},300);
}
jQuery(".toggle_bt").on('click',function(){
    if (jQuery(this).attr("data") == "") {
        toggle_bt_on();
    } else {
        toggle_bt_off();
    }
});
jQuery(function () {
    toggle_bt_off();
});
답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT