17
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獲取#anchor的URL?
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讀取錨點並隱藏/顯示適當的部分?
我不知道它不起作用:| – 2010-12-19 14:25:29
@亞當 - 這不是一個非常有用的描述:)什麼是不工作......你是否正確地使用網址,就像你在問題中一樣? – 2010-12-19 14:27:28
ups位置mising h:D非常感謝matee! – 2010-12-19 14:28:12