Horje
One page hash tag url change on section - Wordpress Solution
[Solved] - One page hash tag url change on section - Wordpress Solution
Try following codes
Hi There, Is someone able to implement this technique? http://benalman.com/code/projects/jquery-hashchange/examples/hashchange So when you click on a menu item, the #section is displayed in the browser url bit. The logo and footer scroll up link would remove any #tag. Ideally need it done within the next few hours! Site url attached as image. Thanks

Solution - 1

so you want to change the title at browser ?


Solution - 2

or you can use this code : http://aidanlister.com/2014/03/persisting-the-tab-state-in-bootstrap/


Solution - 3

have you tried this: http://forum.jquery.com/topic/get-string-in-url-after-hash-and-append-it-to-document http://stackoverflow.com/questions/6573770/append-a-var-to-url-with-jquery-function http://stackoverflow.com/questions/12508225/how-do-we-update-url-or-query-strings-using-javascript-jquery-without-reloading


Solution - 4

Here's a sample snippet based on the window.location, that you could try:

jQuery( function( $ ){

	$( "#nav a[href^=#]").on( "click", function( e ) {
		window.location.hash = this.hash;		
	});
	
	$( "#logo,#menu_top")on( "click", function( e ) {
		window.location.hash = '';		
	});
	  
});
You might also consider window.history.pushState(state, title , url ) but only new browsers support it. Then there is for example the [[LINK href="https://github.com/browserstate/history.js/"]]history.js[[/LINK]] library:
History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.

Date: 2022-10-21 04:56:49
Category: Wordpress
More for You