そのため、URL に含まれる ID に基づいて div を非表示にするスクリプトを作成しています。これは私がこれまでに持っているものです:
<script>
$(function(){
if (document.location.href.indexOf('#aberdeen') > 0)
$("#centralia, #chewelah, #everett, #harbour-pointe").hide();
if (document.location.href.indexOf('#centralia') > 0)
$("#aberdeen, #chewelah, #everett, #harbour-pointe").hide();
if (document.location.href.indexOf('#chewelah') > 0)
$("#aberdeen, #centralia, #everett, #harbour-pointe").hide();
if (document.location.href.indexOf('#everett') > 0)
$("#aberdeen, #chewelah, #centralia, #harbour-pointe").hide();
if (document.location.href.indexOf('#harbour-pointe') > 0)
$("#aberdeen, #chewelah, #everett, #centralia").hide();
if (document.location.href.indexOf('#') < 0)
$(".directory").show();
});
</script>
ただし、URL に ID が追加されていても、それらのすべてが表示されます。何か案は?