一部のjqueryとajaxに問題があります。基本的に、ユーザーはajaxであるフォームを介してログインします。フォームは、ショッピング カート メニューにも使用される jquery onclick ドロップダウン メニューにあります (ネーミング コード (css+jquery) を変更しただけなので、互いに競合しないでください。ユーザーが (ajax 経由で) ログインするまで、両方が正常に機能します)。
これが以下のjqueryコードです
//////Cart App
jQuery(".dropdown-cart dt a").click(function() {
// Change the behaviour of onclick states for links within the menu.
var toggleId = "#" + this.id.replace(/^link/,"ul");
// Hides all other menus depending on JQuery id assigned to them
jQuery(".dropdown-cart dd ul").not(toggleId).hide();
//Only toggles the menu we want since the menu could be showing and we want to hide it.
jQuery(toggleId).toggle();
//Change the css class on the menu header to show the selected class.
if(jQuery(toggleId).css("display") == "none"){
jQuery(this).removeClass("selected");
}else{
jQuery(this).addClass("selected");
}
});
jQuery(".dropdown-cart dd ul li a").click(function() {
// This is the default behaviour for all links within the menus
var text = jQuery(this).html();
jQuery(".dropdown-cart dt a span").html(text);
jQuery(".dropdown-cart dd ul").hide();
});
jQuery(document).bind('click', function(e) {
// Lets hide the menu when the page is clicked anywhere but the menu.
var $clicked = jQuery(e.target);
if (! $clicked.parents().hasClass("dropdown-cart")){
jQuery(".dropdown-cart dd ul").hide();
jQuery(".dropdown-cart dt a").removeClass("selected");
}
});
私はいくつかの.liveコンボを試しました.delgateでも、ユーザーがログインした後でも、ログインとカートのオンクリックメニューの両方がページが更新されるまで機能しません
何か案は??
NZ戦士に乾杯