P
P
para_mid2016-10-26 16:11:32
JavaScript
para_mid, 2016-10-26 16:11:32

How to make working links on the site?

The bottom line is that when you click on a drop-down menu item, the page content corresponding to the item opens, but if you click on another item from the menu again, the page is not updated.
there is a page ../goods/ into which the actual content is loaded via #href
but if you try to click on another "service" again from the same page, it does not load
there is a javascript code that is responsible for this:
if($(" .dropdown").length){
$(".dropdown li.drop ul.sub_menu li a").click(function(e){
e.preventDefault();
location = $(this).attr("href") ;
$("#cont_load").html(data);
}) kitrussia.com/goods
site itself

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton fon Faust, 2016-10-28
@bubandos

I suspect that you have $("#cont_load").html(data); overwrites the html of your menu item as well.
In any case, it's better to hang the page load not on a click, but on a hashchange, for example, like this:

$(window).bind("hashchange", function(e){
    var data = getDataToLoad(); // это функция для получения данных включения в html
    $("#cont_load").html(data);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question