Support "hashchange" event when the menu item is clicked?

Support Forums for LiveMesh Themes & Plugins Forums Appdev Theme Support Support "hashchange" event when the menu item is clicked?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3256
    Jimulabsjimulabs
    Member

    Hi,

    I’d like to track the different page sections in my one-page site with Google Analytics. I’ve found that I could use “window.onhashchange” event to push an even on Google Analytics. However, with the Appdev theme, the url does not change when a menu item is clicked.

    For example, when the “pricing” menu item is clicked, I need the url to be updated to “jimulabs.com/#pricing”. However it’s still “jimulabs.com”.

    Is there anything that I can do to fix this?

    Thanks!

    #3298
    RaghavendraRaghavendra
    Moderator

    There is some discussion on this here –

    https://github.com/kswedberg/jquery-smooth-scroll/issues/27

    The solution is simple (no additional plugins required – pls see the end of the post) if you are are ok with change in history for the back button as discussed in the above post.

    Steps –

    1) Update to the latest version 1.4.13 of the smooth scroll, by downloading the file from

    https://github.com/kswedberg/jquery-smooth-scroll/

    and replacing the current one placed in js/libs/jquery-smooth-scroll.min.js.

    2) Add the option preventDefault: false (default is true which is why the URL does not get updated on click) to the line number 140 in js/main.js file.

    That should do as tested by me.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Appdev Theme Support’ is closed to new topics and replies.