bootstrap modal not working at all

前端 未结 9 2024
有刺的猬
有刺的猬 2021-01-12 16:48

I know this question has been asked hundred of times before and I\'ve been through them but those couldn\'t fix my case :s

This is my code so far

            


        
相关标签:
9条回答
  • 2021-01-12 17:06

    Before posting my complete solution i would like to know , have you initialized your modal before loading it. Initialization:-

    $(function(){
    $('#myModal').modal({
       show:true,
       backdrop:'static'
    });
     //now on button click
      $('#myModal').modal('show');
    });
    
    0 讨论(0)
  • 2021-01-12 17:09

    You've got all of your scripts and css files loaded inside a script tag - take out the script tag that wraps the rest.

    0 讨论(0)
  • 2021-01-12 17:12

    You are not supposed to put the CSS file inside tag!

    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" type="text/css" href="style.css">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"> </script>
    <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"></script>
    <link href="bootstrap/js/bootstrap.min.js" rel="stylesheet" media="screen">
    <link href="bootstrap/js/bootstrap-modal.js" rel="stylesheet" media="screen">
    <link href="bootstrap/js/bootstrap-transition.js" rel="stylesheet" media="screen">
    
    0 讨论(0)
提交回复
热议问题