Last active
January 4, 2017 02:50
-
-
Save nicco88/8ef89f5a1a5ac73de01a057b542b239a to your computer and use it in GitHub Desktop.
toggle menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var payTab = { | |
| onlineMethod: document.getElementById("online-method"), | |
| offlineMethod: document.getElementById("offline-method"), | |
| onlineOption: document.getElementsByClassName("online-option"), | |
| offlineOption: document.getElementsByClassName("offline-option"), | |
| onlineBtn: document.getElementById("online-radio-btn").getElementsByTagName("ins")[0], | |
| toggleOnlineOption: function() { | |
| // toggle online options | |
| for (var i = 0; i < this.onlineOption.length; i++) { | |
| if (this.onlineOption[i].style.display === "") { | |
| this.onlineOption[i].style.display = "none"; | |
| } else { | |
| this.onlineOption[i].style.display = ""; | |
| } | |
| } | |
| // close offline options | |
| for (var i = 0; i < this.offlineOption.length; i++) { | |
| this.offlineOption[i].style.display = "none"; | |
| } | |
| }, | |
| toggleOfflineOption: function() { | |
| //toggle offline options | |
| for (var i = 0; i < this.offlineOption.length; i++) { | |
| if (this.offlineOption[i].style.display === "") { | |
| this.offlineOption[i].style.display = "none"; | |
| } else { | |
| this.offlineOption[i].style.display = ""; | |
| } | |
| } | |
| // close online options | |
| for (var i = 0; i < this.onlineOption.length; i++) { | |
| this.onlineOption[i].style.display = "none"; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment