*

developGr

  • ***
  • 39 posts
Hide a "div id" based on a non filled Attribute
« on: December 07, 2020, 03:17:53 PM »
based on that Attribute of the "Attributes Plugin": <?php if(function_exists('atr_show_attribute')) { echo atr_show_attribute(9); } ?>

if the Attribute of the email its empty then the Attribute will not show up in the item listing. How can i hide a "div id" if this Attribute will not show?

Lest say the div id that i want to hide its that:

<div id="copyemail">
...
</div>

*

MB Themes

Re: Hide a "div id" based on a non filled Attribute
« Reply #1 on: December 08, 2020, 03:35:24 PM »
@developGr
Easiest way is via jquery, where you first identify if content is empty and if yes, then you will hide it.

Sample code (that must be customized by you).

Code: [Select]
<script>
$(document).ready(function() {
  if($('#some-id span.class').text() == '') {
    $('#some-id').hide(0);
  }
});
</script>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots