Semantic-ui: How I can open a modal using button

Created on 31 Dec 2013  路  2Comments  路  Source: Semantic-Org/Semantic-UI

I am using it first time and confused how to open modal on Button
Modal Open

Where I write this code to open modal

  $('.test.modal')
    .modal('show')
  ;

Please Guide me I am trying it since 2 hours on buton

Most helpful comment

I write this in script

$(document).ready(function(){
  $("#mymodalg").click(function(){
  $('.test.modal').modal('show');
  });
});

and put button like this with id mymodalg

and now its working . Thanks

All 2 comments

I write this in script

$(document).ready(function(){
  $("#mymodalg").click(function(){
  $('.test.modal').modal('show');
  });
});

and put button like this with id mymodalg

and now its working . Thanks

This is ages old, but still comes up at the top of goodle for 'semantic ui modal open on click' so putting the official version in here:

$('.test.modal')
  .modal('attach events', '#mymodalg', 'show')
;

From modal examples page

Was this page helpful?
0 / 5 - 0 ratings

Related issues

guilhermeblanco picture guilhermeblanco  路  3Comments

miguelmota picture miguelmota  路  3Comments

batata004 picture batata004  路  3Comments

ghost picture ghost  路  3Comments

iPaoo picture iPaoo  路  3Comments