'jQuery .hide() button when another button active
I have a "Load More" button that has a class named .btn.btn-primary.ng-scope
. When we have some items to show and class .btn.btn-primary.ng-scope.ng-hide
when all units loaded.
My problem is that I have another button "Show All Available Units" with class .btn.btn-primary.custom
. I need to show button "Show ALL Units" ONLY when button "Load More" has class .ng-hide
jQuery(document).ready(function() {
if (jQuery('.btn.btn-primary.ng-hide')) {
jQuery('.btn.btn-primary.custom').show();
}
if (jQuery('.btn.btn-primary.ng-show')) {
jQuery('.btn.btn-primary.custom').hide();
}
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|