Show or hide the element (not the 0% opacity)


(Lydia Lee) #1

Hi,there~
about 4 mouths ago, I find the same question in the hype desk, question here,it use the code like this:
Show:hypeDocument.getElementById(‘id’).style.display = 'block’;
Hide: hypeDocument.getElementById(‘id’).style.display = 'none’;

I’ve tride for many times, it works well, Today, I use the javascript again, but it doesn’t work, Why~~~~~?

Thank you all~~


(Markus Bjerre) #2

Well, you’re using some strange quotations in the code you provided.
I am more of a fan with visibility options though if you still want the item to take up space on the page, check this file:
visibility.hype.zip (10.0 KB)


(Greg) #3

I agree with Mark, it looks like the quotation marks have been copy/pasted from a rich text editor (curly quotes, maybe). If you replace the quote marks while you are in Hype’s javascript editor window, all is well.


(Cipriano Mauricio) #4

Thanks Markus,

Now I know how to assign a class or id to an element via the identity tab.

Aloha