jQWidgets Forums

jQuery UI Widgets Forums General Discussions Navigation Menu, Context Menu How to use hashchange and url: method

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • How to use hashchange and url: method #57029

    Funsho
    Participant

    Hello, Can anyone help me on how I can use haschange to switch between url files in my web directory without refreshing the menu bar. I am using the menu-fluid-size.htm demo in the jqxmenu folder. I a have couple of web pages saved in different directory. I want to click each item on the dropdown menu and load the corresponding pages without refreshing the menu. I got a demo similar to this, but it can only switch between form tags. I want such that will load pages i declare e.g url: ‘myhome/octa.htm’ in the hashchange function

    $(window).hashchange({
    hash: “#!/login/”,

    onSet: function() {

    $(“#login-form”).show();

    },

    onRemove: function() {

    $(“#login-form”).hide();

    },

    });

    // Attach multiple callbacks to different hashes

    $(window).hashchange([{
    hash: “#!/test1/”,

    onSet: function() {

    alert(“#!/test1/ was set”);

    },

    onRemove: function() {

    alert(“#!/test1/ was removed”);

    },

    }, {

    hash: “#!/test2/”,

    onSet: function() {

    alert(“#!/test2/ was set”);

    },

    }]);

    });
    </script>

    Show login form

    Hide login form

    Go to #!/test1/

    Go to #!/test2/

    <small>You can also trigger all events manually by just changing the hash part of the page url.</small>

    <form id=”login-form” action=”.” style=”display: none;”>

    <label for=”username”>Username</label>

    <input id=”username” type=”text”>

    <label for=”password”>Password</label>

    <input id=”password” type=”password”>

    <input type=”submit” value=”Sign in”>

    </form>

    </body>

    </html>


    Peter Stoev
    Keymaster

    Hi Funsho,

    We don’t know how you can use hashchange. We don’t have such method in our code base.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.