私はスマートでメニュー項目の色を変更したい他のページにリダイレクトする前にクリックしたときに私は別の戦術を使用しましたが、誰も成功しません。ここに私が使用したコード/スクリプトがあります
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");
});
回答:
回答№1は0 $(".mobile-menu a").click(function (e) {
e.preventDefault();
$(e.target).css({"color","#9e1b64"});
setTimeout("window.location.href="+$(e.target).attr("href"), 1000);
});