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;
});
});
As you can see, by default #red-products is hidden and #red-information is visible. Sometimes I want #red-products to be visible and #red-information hidden, meaning something like
http://localhost/networks2/profile.php?id=1&offset=1#products
to show #red-products and hide #red-information. And
http://localhost/networks2/profile.php?id=1&offset=1#information
to hide #red-products and show #red-information.
How can I read anchor from URL using jQuery, and hide/show appropriate sections?
Seperti yang telah disebutkan, makna yang paling umum dari kata “get” adalah “menerima” atau “mendapatkan sesuatu”. Sesuatu yang dimaksud biasanya berupa barang ataupun uang.
“Get” adalah kata kerja (verb). “Get” adalah bentuk present tense dari “to get”. Kita sebagai orang Indonesia mungkin lebih mengenal istilah “present tense” sebagai verb 1 (V1) atau kata kerja bentuk pertama.
“Get” adalah bentuk present tense dari verb (kata kerja) “to get”. Kita orang Indonesia mengenal “get” sebagai verb 1 atau kata kerja bentuk 1 (v1). Karena berbentuk present tense, “get” hanya boleh digunakan dalam kalimat dengan tenses di bawah ini: Present simple.
You can change the initial hide to be based on window.location.hash, by replacing this:
$("#red-products").hide();
With this:
$("#red-products, #red-information").hide();
$("#red-" + (window.location.hash.replace("#", "") || "information")).show();
This will hide both initially, then show the hasd (#red-hashhere), or default to showing #red-information as you have now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With