在智能手机上单击菜单项时,首先它应该更改其颜色,然后转到页面



我想在重定向到其他页面之前更改智能手机上菜单项的颜色。我使用了不同的策略,但没有人成功。这是我使用过的代码/脚本

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

相关内容

最新更新