eelias Posted December 9, 2013 Share Posted December 9, 2013 Hi there! I am trying to make a TUniPanel Fadein and then Fadeout. On this panel I have only a TUniLabel. I am trying to make something like the ToastMessages we find on Android Phones, those little messages that shows up for few seconds. I have added a TUniTimer on the form, and I set it to fire an event on 5 seconds; When showing the message i use: UniSession.AddJS(UnPanelMessage.JSName + '.animate({ duration: 1000, to: { opacity: 1 });'); Then, when the Timer event is fired, I use UniSession.AddJS(UnPanelMessage.JSName + '.animate({ duration: 1000, to: { opacity: 0 });'); However the panel just do not show up. If I remeve this line, and change my code for something like UnPanelMessage.Visible := true and then UnPanelMessage.Visible := false It works fine, so my code is working fine, the panel is visible, the color is correct, timer is working, etc. But when I add the JS code it simply does not show. I have changed the opacity from 1 to 0 on start etc I wonder if someone could give a hand on that. Eduardo Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 9, 2013 Share Posted December 9, 2013 Hi eelias. Maybe not the best solution... If you created a form with UniPanel1.Visible := False, then 1. Change the Visible property to true: UniPanel1.Visible = True; 2. Then, add beforeInit to UniPanel1 -> UniEvents function beforeInit(sender) { sender.animate({ duration: 1, to: { opacity: 0 }}); } 3. Then you can use your code. UniSession.AddJS(UnPanelMessage.JSName + '.animate({ duration: 1000, to: { opacity: 1 });'); UniSession.AddJS(UnPanelMessage.JSName + '.animate({ duration: 1000, to: { opacity: 0 });'); Sincerely (Sorry if I misunderstood the question...) Quote Link to comment Share on other sites More sharing options...
chefdackel Posted December 10, 2013 Share Posted December 10, 2013 I am trying to make a TUniPanel Fadein and then Fadeout. On this panel I have only a TUniLabel. I am trying to make something like the ToastMessages we find on Android Phones, those little messages that shows up for few seconds. if its only for nice messages which shows up for a few seconds(or until the user moves the mouse) , take a look at humanejs notification system: http://forums.unigui.com/index.php?/topic/1808-humanejs-notification-system-for-unigui/ works great in my actual test project. Quote Link to comment Share on other sites More sharing options...
eelias Posted December 18, 2013 Author Share Posted December 18, 2013 if its only for nice messages which shows up for a few seconds(or until the user moves the mouse) , take a look at humanejs notification system: http://forums.unigui.com/index.php?/topic/1808-humanejs-notification-system-for-unigui/ works great in my actual test project. Thank you! You helped me a lot with you code, It was exactly what I needed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.