Print Page | Close Window

How to toggle Visible/Invisible by button?

Printed From: openElement Website
Category:

openElement


Forum Name: Element Editor
Forum Description: Create and share your own custom elements to use with openElement
URL: https://forums.openelement.uk/en/forum_posts.asp?TID=860
Printed Date: Apr 19 2024 at 9:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to toggle Visible/Invisible by button?
Posted By: djju1029
Subject: How to toggle Visible/Invisible by button?
Date Posted: Oct 05 2016 at 10:30pm
Dear OE Team,

I want to toggle visibility property of Key Input Form eleement from visible to invisible(or vice versa) by click the button. (such as locking mode)

How to implement this function? I spent whole two days to figure it out but I couldn't....Cry

I appreciate your kind answer in advance.

DJ



Replies:
Posted By: Dmit OE
Date Posted: Oct 06 2016 at 9:00am
Hi,

Into Properties, put a Custom Class "toggle" onto the element to hide, and "toggle-btn" onto the "button" element. Then, add a Code Block (Source) type Javascript:

$(function(){
  $('.toggle-btn').click(function(){ $('.toggle').toggle(); });
});


Posted By: Dmit OE
Date Posted: Oct 06 2016 at 9:01am
P.S.to always hide / show element on click, use hide() / show() instead of toggle()


Posted By: djju1029
Date Posted: Oct 07 2016 at 2:46pm
Thanks for your answer! I will try it.

By the way, is it the same way to toggle the READONLY property of text input form?


Posted By: djju1029
Date Posted: Oct 07 2016 at 3:49pm
I am sorry but I have no idea how to do the custom class.

Is it like this picture? https://drive.google.com/open?id=0B72Ay6Ww5uDcWGRjTTVKMVNnamc" rel="nofollow - https://drive.google.com/open?id=0B72Ay6Ww5uDcWGRjTTVKMVNnamc


Posted By: Dmit OE
Date Posted: Oct 08 2016 at 3:36pm
Yes



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net