doubts with modal and javascript

Asked

Viewed 53 times

0

I have this modal:

<div class="uk-modal" id="modalbaixados">
<div class="uk-modal-dialog">
    <div class="uk-form-row">
        <div class="uk-grid">

            <div><h3 class="heading_a"> Baixas parciais do lançamento selecionado</h3></div>

        </div>
    </div>
</div>

<div class="uk-width-medium-2-10">
    <!--botão fechar modal-->
    <a class="md-btn md-btn-danger md-btn-wave-light md-btn-small uk-modal-close" bg>Fechar</a>
</div>

to open the modal:

<a href="#modalbaixados" data-uk-modal="{ center:true, bgclose:true }">

this works perfectly, however I will need to open the modal from a javascript function, so in this function I need a code to open the modal:

 //abrir modal
$scope.abrirModal = function (conta) {       
    como abrir a modal?
}

I’ll need to also close this modal by a function:

//fechar modal
$scope.fecharModal = function () {       
    como fechar a modal?
}

how to do this ?

  • Have you tried the documentation example? https://getuikit.com/v2/docs/modal.html#javascript

  • $('.modalSelector').on({&#xA;&#xA; 'show.uk.modal': function(){&#xA; console.log("Modal is visible.");&#xA; },&#xA;&#xA; 'hide.uk.modal': function(){&#xA; console.log("Element is not visible.");&#xA; }&#xA;}); - .modalSelector would be what ? the modal id ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.