Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. toggleTabs:
  2. function(e) {
  3. var elEvent = e || window.event;
  4. var elTarget = null;
  5. if (elEvent) {
  6. elTarget = elEvent.target;
  7. if (elTarget == null)
  8. elTarget = elEvent.srcElement;
  9.  
  10. // Ignore event if shopper clicks on active tab.
  11. if (elTarget && elTarget.className != "tab_on") {
  12. var id = elTarget.id;
  13. if (id.indexOf(ProStores.Detail.ID_DIV_TAB) != -1) {
  14. var nIdx = id.substring(ProStores.Detail.ID_DIV_TAB.length);
  15.  
  16. for (var i = 0; i < ProStores.Detail.nTabCount; i++) {
  17. var j = i + 1;
  18. var strClassName = "tab_off";
  19. var elDesc = _(ProStores.Detail.ID_DIV_DESC + j);
  20. if (elDesc) {
  21. if (j == nIdx)
  22. elDesc.style.display = "inline";
  23. else
  24. elDesc.style.display = "none";
  25. }
  26. var elTab = _(ProStores.Detail.ID_DIV_TAB + j);
  27. if (elTab) {
  28. if (j == nIdx)
  29. elTab.className = "tab_on";
  30. else
  31. elTab.className = "tab_off";
  32. }
  33. }
  34. }
  35. }
  36. }
  37. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement