2015-07-18 3 views
0

Может кто-нибудь это понять, я не могу заставить модальный работать. Консоль браузера показывает эту ошибку: Uncaught TypeError: $(...).modal is not a function

Я пробовал раскомментировать Query.noConflict(); и jQuery(function($){}, но это не имеет никакого значения.

<!DOCTYPE html> 
<html> 
    <head> 
     <link rel="stylesheet" type="text/css" class="ui" href="http://oss.maxcdn.com/semantic-ui/2.0.4/components/modal.min.css"> 
     <link rel="stylesheet" type="text/css" class="ui" href="http://oss.maxcdn.com/semantic-ui/2.0.4/components/button.min.css"> 

     <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> 
    </head> 

    <body> 
     <button class="ui button">Test</button> 

     <div class="ui modal my-dialog"> 
      <i class="close icon"></i> 
      <div class="content"> 
      <div class="description"> 
       <div class="ui header">Text stuff here.</div> 
      </div> 
      </div> 
      <div class="actions"> 
      <div class="ui black deny button"> 
       Nope 
      </div> 
      <div class="ui positive right labeled icon button"> 
       Yep, that's me 
      </div> 
      </div> 
     </div> 

     <script> 
      $(document).ready(function() { 
       console.log("document loaded"); 
       // jQuery.noConflict(); 

       // Your jQuery code here, using the $ 
       // jQuery(function($){     
        $('.ui.modal.my-dialog') 
         .modal('show'); 
       // });    
      });       
     </script 
    </body> 
</html> 

ответ

2

Вы включали CSS плагина, но не его JavaScript. Вам также необходимо включить JavaScript (после тега скрипта, включая jQuery).

Смежные вопросы