Jump to content

Get an UIKIT Alert to diappear after a few seconds.


Recommended Posts

Posted

Hi there

I am using an UIKIT alert box in a frontend template:

<div class="uk-alert-success uk-text-center" uk-alert>
    <a class="uk-alert-close" uk-close></a>
    <h3><?=$Success.$SuccessText?></h3>
</div>

It already has a close button , but i want it to disappear after some seconds even if you don't close it manually.

UIKIT docs seem to say its possible , but i cannot find an example on how its done. 

Thanks in advance !

 

 

 

 

Posted

Another issue is that the element is only faded , so if you have several warnings , they stull use up their space after they have faded. 

If you close em they are removed. 

Posted

I'm not a UIKit expert by any means. In fact, you should have posted this question in the "dev talk" thread. This doesn't have anything to do with ProcessWire per se.

I guess you have the most control if you trigger the alert via JS, and setTimeout(). I don't know if you can fine-tune the animation duration. Maybe someone else who uses this framework regularly knows more.

  • Like 1
Posted

@NorbertH

I'm not using UIkit but as I understand from components list, they have "Notification" component which intended to close automatically. Or you can use JS example from @bernhard

  • Like 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...