Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems matching the layout with the URL
    primarykey
    data
    text
    <p>I'm working on a little project and i have a question. The website i'm working on is structured like this: <img src="https://i.stack.imgur.com/xUDtG.png" alt="3 box layout with pager"> All the sections of the website are in the same document, where on the layout the upper blue part is the menu, and the numbers change the position (using jQuery) of the 1 2 3 divs moving the selected section in the center of it and the others out from the layout.</p> <pre><code> $("li").click(function() { var selectedText = $(this).text(); $(this).addClass("active"); $(this).siblings().removeClass("active"); if (selectedText == "Upload") { $('#homePage').animate({ left: 2000 }, 1000); $('#upload').animate({ left: 105 }, 1000); $('#explore').animate({ left: 2000 }, 1000); } if (selectedText == "Gallery") { $('#homePage').animate({ left: 0 }, 1000); $('#upload').animate({ left: -2000 }, 1000); $('#explore').animate({ left: 2000 }, 1000); } if (selectedText == "Explore") { $('#homePage').animate({ left: -2000 }, 1000); $('#upload').animate({ left: -4000 }, 1000); $('#explore').animate({ left: -2000 }, 1000); } }); </code></pre> <p>What i need to do now is changing properly the url of the website as i change the section, and i would like to be able to get to the proper section by the url. I tried the location.hash method but as i change the hashtag value the jquery animation of the sliding move wrongly the divs (using the same code posted up here having "var selectedText" as the hash value)... I was searching for a solution and i found the HTML5 pushState but i can't really figure out how to use it in my case, since i don't have any AJAX request or anything. Thanks to everyone!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload