Jump to content

TUniPanel animation


kaki

Recommended Posts

Hello,
I'm trying to make a simple animation that I've seen in some examples on the forum: 

I use the following instruction

UniSession.AddJS(UniPanel1.JSName + '.el.fadeIn({duration: 1000})');

but it doesn't work for me, I get the following error:

 

Cannot read properties of undefined (reading 'fadeIn')

Thank,

Link to comment
Share on other sites

with TUniPanel.Create(self) do begin
    Name:='test_sss';
    Parent:=panelPadre;
    Caption:='Test label';
    UniSession.AddJS(JSName + '.el.fadeIn({duration: 1000})');
end;

It's just an example where I create a dashboard at runtime. I have captured it from forum examples

Link to comment
Share on other sites

6 minutes ago, kaki said:
with TUniPanel.Create(self) do begin
    Name:='test_sss';
    Parent:=panelPadre;
    Caption:='Test label';
    UniSession.AddJS(JSName + '.el.fadeIn({duration: 1000})');
end;

Where are you using these codes?


In my case, let's say in the button click handler, this code works, at least without an error.

Link to comment
Share on other sites

procedure TFCompras_Dashboard.UniButton1Click(Sender: TObject);
begin
with TUniPanel.Create(self) do begin
    Name:='test_sss';
    Parent:=panelPadre;
    Caption:='Test label';
    JSInterface.JSConfig('style', [JSControl.JSObject('opacity: 0')]);
    JSInterface.JSCall('getEl().fadeIn', [JSControl.JSObject('duration: 1500')]);
end;
end;


With this code it works perfect! but you would have to do it from a procedure, without clicking a button. I'm going to try using some event of the frame

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...