jQuery   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – 为什么这个引导下拉例子不行?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我只是尝试在Bootstrap文档中的示例,但似乎不起作用.我只是得到纯 HTML.这是我的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<Meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="bootstrap.css" type="text/css">
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>

$('.dropdown-toggle').dropdown();


</script>
<title>Dropdown</title>
</head>

<ul class="nav nav-pills">
  <li class="active"><a href="#">Regular link</a></li>
  <li class="dropdown" id="menu1">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
      Dropdown
      <b class="caret"></b>
    </a>
    <ul class="dropdown-menu">
      <li><a href="#">Action</a></li>
      <li><a href="#">Another action</a></li>
      <li><a href="#">Something else here</a></li>
      <li class="divider"></li>
      <li><a href="#">Separated link</a></li>
    </ul>
  </li>
  ...
</ul>

</body>
</html>

有没有人看到这个问题?谢谢.

解决方法

我看到你的标记有两个问题.

首先,你将jquery插件之前的引导插件包含在前面. jquery第一,bootstrap插件第二.

其次,您正在使用引导程序不支持的DOCTYPE,您必须使用HTML5的DOCTYPE:

<!DOCTYPE html>

大佬总结

以上是大佬教程为你收集整理的jquery – 为什么这个引导下拉例子不行?全部内容,希望文章能够帮你解决jquery – 为什么这个引导下拉例子不行?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。