Osclass Support Forums

Osclass plugin support => Attributes Plugins => Topic started by: developGr on December 07, 2020, 03:17:53 PM

Title: Hide a "div id" based on a non filled Attribute
Post by: developGr 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>
Title: Re: Hide a "div id" based on a non filled Attribute
Post by: MB Themes 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>