Hi, hope someone can help. I want to hide the fragment identifier from the address bar, and instead:
www.mydomain.com/example.html#something
I just get:
www.mydomain.com/example.html
when I click on the anchor tag.
I reviewed a lot of related questions and forums, but still can't figure it out. I am sure I should use something like:
window.location.href.replace(/#.*/,''); //and or .hash
just can't understand.
The localScroll plugin allows you to hide or save identifiers, and by default they are hidden. I think many gallery plugins have a similar option.
but when I try to do it myself (a novice bit), I get a crazy result.
below is some basic example script I would like it to work with:
<style> .wrap{ width:300px; height:200px; margin:auto; } .box{ width:300px; height:200px; position:absolute; display:none; } #one{background:red;} #two{background:blue;} #three{background:green;} .load{display:block;} </style> <body> <ul> <li><a href="#one">One</a></li> <li><a href="#two">Two</a></li> <li><a href="#three">Three</a></li> </ul> <div class="wrap"> <div id="one" class="box load">This is Box 1</div> <div id="two" class="box">This is Box 2</div> <div id="three" class="box">This is Box 3</div> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function() { $("ul li a").click(function(){ $("div.box").fadeOut(1000); $($(this).attr('href')).fadeIn(1000); }); }); </script> </body>
javascript jquery
thom
source share