Matt Simoncavage
Posts: 0
Joined: Thu Jun 04, 2015 7:10 pm

Hide element if storage variable equals the current page.

Is there a way I can tell an element on the page not to show using element.hide(); only if a storage variable I have mapped to that element is equal to the name of the page I'm on?

Something like:
If storage = page name, hide element.

Thanks.

Tech Xcellent
Posts: 0
Joined: Wed Nov 18, 2015 6:18 am

Hide element if storage variable equals the current page.

Hey Matt,
I use this code myself, if the element has no 'data value' present, the element is hidden from sight. It should work for you, no idea how you'll use it though.

$("textarea.hide-textarea").each(function(){

Code: Select all

if(!$(this).val()){ 
    $(this).hide(); 
} 

});

This part: textarea.hide-textarea, to explain: The name of the component "textarea." & then the class name "hide-textarea", you will need to replace these two element's with your own values (eg: button.hide-button << or something similar).

Image

I hope this helps,

Let me know if it helps.

Thank you,

  • Benj

Return to “Issues”