2017-05-14 8 views
0

jquery-confirmを使用しようとしています。以下のコードと結果をご覧ください。結果はウェブサイトで見たと同じではありません。何か間違っている?jquery-confirmで幅を設定できませんでしたか?

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="UTF-8"> 
    <meta name="Generator" content="EditPlus®"> 
    <meta name="Author" content=""> 
    <meta name="Keywords" content=""> 
    <meta name="Description" content=""> 
    <title>Document</title> 
    <script src="../js/jquery-3.2.1.min.js"></script> 
    <link rel="stylesheet" href="../jquery-confirm-master/dist/jquery-confirm.min.css"> 
<script src="../jquery-confirm-master/dist/jquery-confirm.min.js"></script> 
</head> 
<body> 
<script> 
    $.alert({ 
    width :'auto', 
    title: 'Alert!', 
    content: 'Simple alert!' 
}); 
</script> 
</body> 
</html> 

the picture after running the code

答えて

0

次を追加する必要があり、または単にブートストラップを追加しようように思えます。

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.0.3/jquery-confirm.min.css"> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.0.3/jquery-confirm.min.js"></script> 
+0

これは質問への回答を提供しません。十分な[評判](https://stackoverflow.com/help/whats-reputation)があれば、[投稿にコメントする]ことができます(https://stackoverflow.com/help/privileges/comment)。代わりに、[質問者からの明確化を必要としない回答を提供する](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an- i-do-代わりに)。 - [レビューの投稿](/レビュー/低品質の投稿/ 18770724) – GGO

0
それが正常に動作していますが、ブートストラップのテーマを無効にする必要があるため、次のコードを参照して期待通りに表示されていない

<script> 
    $.alert({ 
     width :'auto', 
     title: 'Alert!', 
     content: 'Simple alert!', 
     useBootstrap: false // Key line 
    }); 
</script> 

をしかし、あなたはあなたがCDNリンク次のものが含まれなければならないのブートストラップのテーマを使用する場合は、あなたの資料。

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.0.3/jquery-confirm.min.css"> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.0.3/jquery-confirm.min.js"></script> 
関連する問題