2017-10-25 11 views
0

다른 페이지로 리디렉션되기 전에 클릭하면 스마트 폰의 메뉴 항목의 색상을 변경하고 싶습니다. 나는 다른 전술을 사용했지만 아무도 성공하지 못합니다. 다음은 내가 사용한 코드/스크립트입니다.메뉴 항목을 스마트 폰에서 클릭하면 먼저 색상이 바뀌고 페이지로 이동합니다

jQuery(document).on('click touchstart','.mobile-menu a',function(){ 
    jQuery(this).css('color','#9e1b64'); 
    }); 


    jQuery(document).on('click touchstart','div.text_only',function(){ 
    jQuery(this).css('color','#9e1b64'); 
    }); 


    jQuery("body").delegate(".text_only", "click", function() { 

     jQuery(this).css('color','#9e1b64'); 
    }); 


jQuery(document).ready(function() { 
jQuery(".mobile-menu a").click(function (e) { 
     e.preventDefault(); 
     jQuery(this).css('color','#9e1b64'); 
}); 
}); 


jQuery(document).on("mousedown", ".mobile-menu a", function() { 
    jQuery(this).css('color','#9e1b64'); 
}); 


jQuery(document).ready(function(){ 
    jQuery('.mobile-menu a').on('click touchstart', function() { 
     jQuery(this).css('color','#9e1b64'); 
    }); 
}); 


jQuery(document).on("vclick", ".mobile-menu a", function() { 
    jQuery(this).css('color','#9e1b64'); 
    }); 


    jQuery(".mobile-menu a").bind("click touchstart", function() { 
    jQuery(this).css('color','#9e1b64'); 
}); 

답변

0
$(".mobile-menu a").click(function (e) { 
      e.preventDefault(); 
      $(e.target).css({'color','#9e1b64'}); 
setTimeout('window.location.href='+$(e.target).attr('href'), 1000); 
    });