BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
Forum Home Forum Home >

openElement

> Element Editor
  New Posts New Posts RSS Feed - How to toggle Visible/Invisible by button?
  FAQ FAQ  Forum Search   Register Register  Login Login

How to toggle Visible/Invisible by button?

 Post Reply Post Reply
Author
Message
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 Août 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Topic: How to toggle Visible/Invisible by button?
    Posted: 05 Oct 2016 at 23:30
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


Edited by djju1029 - 05 Oct 2016 at 23:31
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: 31 Mai 2012
Status: Offline
Points: 5281
Post Options Post Options   Thanks (1) Thanks(1)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: 06 Oct 2016 at 10:00
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(); });
});
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: 31 Mai 2012
Status: Offline
Points: 5281
Post Options Post Options   Thanks (1) Thanks(1)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: 06 Oct 2016 at 10:01
P.S.to always hide / show element on click, use hide() / show() instead of toggle()
Back to Top
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 Août 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Posted: 07 Oct 2016 at 15:46
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?
Back to Top
djju1029 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 02 Août 2016
Location: the US
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote djju1029 Quote  Post ReplyReply Direct Link To This Post Posted: 07 Oct 2016 at 16:49
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
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: 31 Mai 2012
Status: Offline
Points: 5281
Post Options Post Options   Thanks (1) Thanks(1)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: 08 Oct 2016 at 16:36
Yes
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,031 seconds.