Created
July 8, 2020 14:15
-
-
Save mhamzas/7dbb8633c7ee31102e1fe707651c4129 to your computer and use it in GitHub Desktop.
Toggle Class (classList Approach)
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
| /*to show the image*/ | |
| .SelectedBorderOrgType .markIcon { | |
| display: block; | |
| } | |
| /*to hide the image*/ | |
| .NonSelectedBorderOrgType .markIcon { | |
| display: none; | |
| } | |
| .SelectedBorderOrgType .pillLabel1 { | |
| font-weight: 600; | |
| } | |
| .NonSelectedBorderOrgType{ | |
| font-weight : normal; | |
| } |
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
| <div class="NonSelectedBorderOrgType" onclick={toggleOrgType}> | |
| <img class="markIcon" src={markIcon} alt='marked'> | |
| <div class="pillLabel1">{type.LKUP_DSC__c}</div> | |
| </div> |
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
| toggleOrgType(event){ | |
| const evt = event.currentTarget; | |
| evt.classList.toggle('SelectedBorderOrgType'); | |
| evt.classList.toggle('NonSelectedBorderOrgType'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment