Created
March 3, 2023 11:55
-
-
Save exmmth/e6817a6524c9da508067ee663ba6c953 to your computer and use it in GitHub Desktop.
this code hides current page block from grid blocks, uk-grid yootheme pro page builder
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
//hide current page from grid | |
let grid_class = 'fix-grid';//name of the grid class | |
if(document.querySelectorAll('.' + grid_class).length){ | |
let cur_url = window.location.pathname, | |
grid_list = document.querySelectorAll('.' + grid_class +' > div > div'); | |
Array.prototype.forEach.call(grid_list, function(el){ | |
if(el.querySelectorAll('a')[0].getAttribute('href') == cur_url){ | |
el.classList.add('uk-hidden'); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment