jQuery(document).ready(function(){
$("#red-products").hide();
$("#content-info").click(function(event){
$("#red-products").hide();
$("#red-information").show();
});
$("#content-product").click(function(event){
$("#red-information").hide();
$("#red-products").show();
});
$("#more").click(function(event){
load(this.href);
return false;
});
});
ご覧のとおり、デフォルトでは#red-products
が非表示になり、#red-information
が表示されます。時々私は#red-products
を示し、#red-information
を非表示にするjQueryを使用してURLの#anchorを取得しますか?
http://localhost/networks2/profile.php?id=1&offset=1#products
のようなものを意味し、#red-products
が見えると#red-information
隠しになりたいです。そして
http://localhost/networks2/profile.php?id=1&offset=1#information
#red-products
を隠し、#red-information
を表示します。
jQueryを使用してURLからアンカーを読み取り、適切なセクションを非表示にするにはどうすればよいですか?
私はそれを取得しないでくださいそれは動作しません:| –
@Adam - それは非常に有用な説明ではありません:)何がうまくいかないのですか?あなたは質問にあるとおり正確にURLを使用していますか? –
ups location mising h:Dありがとう! –