我有以下代码
<div id="tab1" data-bind="visible: saleListVM.showSortPanel && auctionBranchListVM.SelectedItem() && saleListVM.ItemsCount() > 0">
<ul id="tabnav">
<li data-bind="click: saleListVM.sortTabClicked, css: { tab1: saleListVM.showSortPanel() }"><a href="index.html">@Html.LocalizeText(Resources.RT_GENERAL,"Sort")</a></li>
<li data-bind="click: saleListVM.groupTabClicked, css: { tab1: saleListVM.showGroupsPanel() }"><a href="#">@Html.LocalizeText(Resources.RT_GENERAL,"Group")</a></li>
</ul>
</div>
功能
groupTabClicked: function (val) {
GAForNewListingAndDetails('New AC Listing', 'Sale List GROUP Click', '');
saleListVM.showGroupsPanel(true);
saleListVM.showSortPanel(false);
saleListVM.altView(false);
loadGroupSaleList(auctionGroupListVM.selectedGroupItem());
detailWidth();
},
sortTabClicked: function (val) {
GAForNewListingAndDetails('New AC Listing', 'Sale List SORT Click', '');
saleListVM.showGroupsPanel(false);
saleListVM.showSortPanel(true);
saleListGroupTypeId = null;
saleListGroupId = null;
saleListGroupName = "";
saleListVM.DisplaySortByLane(true);
saleListVM.DisplaySortByItem(true);
initSaleListScroller();
detailWidth();
},
此处在DOM元素中,当调用groupTabClicked()时要隐藏id = tab1的iediv,并在调用sortTabClicked()时显示