3.2.0

How to cache a tab's target.

Hello ActiveWidgets Gurus!

I have a set of 4 tabs as shown in the code below. How can the target for each tab be cached so that if someone has gone halfway down page1.htm, then goes to page2.htm and back to page1.htm, page1.htm still remains half way down the page?

<script>

var names = ["Page1", "Page2", "Page3", "Page4"];

var values = ["page1.htm" , "page2.htm" , "page3.htm" , "page4.htm"];

var tabs = new AW.UI.Tabs;
tabs.setId("myTabs");
tabs.setItemText(names);
tabs.setItemValue(values); // store page URLs in the 'value' property.
tabs.setItemCount(4);
tabs.refresh();

tabs.onSelectedItemsChanged = function(selected){

var index = selected[0];
var value = this.getItemValue(index);
window.status = index + ": " + value;
document.getElementById("myContent").src = value; // iframe URL
}

tabs.setSelectedItems([0]); // load the first page.

</script>
whodunnit
January 8,
I guess you should remember scrollTop value of the page in iframe and restore it when the page is loaded again.
Alex (ActiveWidgets)
January 9,

This topic is archived.

See also:


Back to support forum