forforfor:
i tried to use that but apparently, it did not work. What i want is for third tab when i press refresh button, it will reload the page and stay at third tab. While when i go to the fourth tab, when i click yes, it will direct me to the first tab.
Yes, it is definitely possible. I have put together a small working demo for you.
Note, that codepen disables window.location commands. The technique though works just fine in the real world though.
The scripting code is minimal, but fully works.
$("#tabs").tabs({
activate: function(event, ui) {
localStorage.selectedTab = ui.newTab.index() + 1;
},
active: (localStorage.selectedTab) ? localStorage.selectedTab - 1 : 0
});
$("#refreshRef").on("click", function () {
window.location.reload();
});
$("#backToLive").on("click", function () {
$("#tabs").tabs("option", "active", 0);
});
$("#exitSite").on("click", function () {
window.location = "http://www.google.com";
});
Hey. Thanks for replying, anyway, for this javascript, do i just put it before ? like
[quote=âforforfor, post:65, topic:224247, full:trueâ]
Hey. Thanks for replying, anyway, for this javascript, do i just put it before ?
Yes indeed. Take a look at the sample code to see how the $(â#backToLive â) parts work with the existing HTML content.
You can also see a more complete working example at http://fiddle.jshell.net/pmw57/6btcznrw/4/show/light/ and explore its code at https://jsfiddle.net/pmw57/6btcznrw/4/
May i know is there a way to remove the grey tab beside my reference ? as i shift the logout tab to the most right.
I cannot tell you how to fix that because you havenât shown us the code for how youâve moved it.
Things do seem to work well on my test page though when I move the last tab to the right.
The CSS that Iâm using to move the last tab to the right is:
.ui-tabs-nav li:last-child {
float: right;
}
You can see the example at https://jsfiddle.net/pmw57/6btcznrw/5/
I tried to use that css but didnt manage to work. Do i put at my html css or jquery css.
system
Closed
August 18, 2016, 3:00pm
70
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.