S
S
Sergey Pozdnyakov2018-06-21 05:31:40
JavaScript
Sergey Pozdnyakov, 2018-06-21 05:31:40

How to implement a non-reloadable wordpress menu?

Explain how to make a menu in wordpress so that it is not overloaded on the site pages. For example, betheme templates are made according to this principle: themes.muffingroup.com/be/webdesign
On the site redcollar.ru, the content is also changing, without reloading...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ice, 2018-06-21
@IceRD

Update only content.
For example, the principle is as follows.
You track a click on a link in the menu, do ajax to your script handler.

var request = $.ajax({
  url: "script.php",
  method: "GET",
  data: { id : menuId },
  dataType: "html"
});

script.php handles the request and builds the page content.
The received response from ajax is loaded onto the page by adding / replacing the block.
success: function(html){  
 $("#content").html(html);  
}

and read about HTML History API
As an example https://code.tutsplus.com/tutorials/an-introductio...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question