GVKun编程网logo

jquery – 尝试使用bootstrap navbar品牌和scrollTop()

11

对于想了解jquery–尝试使用bootstrapnavbar品牌和scrollTop()的读者,本文将是一篇不可错过的文章,并且为您提供关于bootstrap+bootstrap-table+jqu

对于想了解jquery – 尝试使用bootstrap navbar品牌和scrollTop()的读者,本文将是一篇不可错过的文章,并且为您提供关于bootstrap + bootstrap-table + jquery + bootstrap-paginator、Bootstrap css在navbar navbar-fixed-top下面隐藏容器部分、bootstrap jquery.slimscroll、Bootstrap 抛出未捕获的错误:Bootstrap 的 JavaScript 需要 jQuery的有价值信息。

本文目录一览:

jquery – 尝试使用bootstrap navbar品牌和scrollTop()

我正在尝试使用bootstrap和jQuery创建单页网站.我已经这样做了,每当你点击其中一个< li>时,它就会加载内容,使用scrollTop()函数垂直居中.
但它不适用于导航栏品牌.我已经尝试了一切半.

半相关的HTML

<div>
 <!-- if buttonn active -->
  <nav>
 <div>
  <!-- Brand and toggle get grouped for better mobile display -->
  <div>
    <button type="button">
    <span>Toggle navigation</span>
    <span></span>
    <span></span>
    <span></span>
    </button>

  <ahref="#">Brand</a>
  </div>
  <divid="bs-example-navbar-collapse-1">
    <ul>
      <li id="myStory"><a href="#">My Story</a></li>
      <li id="webCoding"><a href="#">Web Coding</a></li>
      <li id="personalTraining"><a href="#">Personal Training</a></li>
      <li id="music"><a href="#">Music</a></li>
    </ul>

jQuery的:

$(".navbar-brand").on("click",function(e) {
e.preventDefault();
 eliezerButton();
$(".scrollUp").scrollTop();

解决方法

使用您提供的代码很难.但是你在导航栏类中使用topNavBar作为类不是引导类.不确定它是否是您创建的类,但这可能是您问题的一部分.

bootstrap + bootstrap-table + jquery + bootstrap-paginator

bootstrap + bootstrap-table + jquery + bootstrap-paginator

 

http://127.0.0.1:8848/pangBo/index.html

 

 

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
		 crossorigin="anonymous">
		<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
		 crossorigin="anonymous"></script>
		<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/bootstrap-table.min.css">
		<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/bootstrap-table.min.js"></script>
		<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.12.1/locale/bootstrap-table-zh-CN.min.js"></script>
		<script src="js/bootstrap-paginator.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div>
			<formrole="search">
				<div>
					<div>
						<div>
							<label>客户编号: </label>
							<div>
								<input type="text"placeholder="">
							</div>
						</div>
						<div>
							<label>客户姓名: </label>
							<div>
								<input type="text"placeholder="">
							</div>
						</div>
						<div>
							<label>手机号码: </label>
							<div>
								<input type="text"placeholder="">
							</div>
						</div>
					</div>
					<div>
						<div>
							<label>客户编号: </label>
							<div>
								<input type="text"placeholder="">
							</div>
						</div>
						<div>
							<label>客户编号: </label>
							<div>
								<input type="text"placeholder="">
							</div>
						</div>
						<div>
							<label>客户编号: </label>
							<div>
								<input type="text"placeholder="">
							</div>
						</div>
					</div>
					<div>
						<button type="submit">查询</button>
					</div>
				</div>
			</form>
		</div>
		<div>
			<divrole="group" aria-label="...">
				<button type="button" id="btn-one">可撤单</button>
				<button type="button" id="btn-two">已撤单</button>
			</div>
		</div>
		<div id="table-one">
			<table id="table"></table>
			<div>
				<div id="example">
					<ul id="pageLimit"></ul>
				</div>
			</div>
		</div>
		<div id="table-two">
			<table id="table-ta-one"></table>
			<div>
				<div id="example-two">
					<ul id="pageLimit-two"></ul>
				</div>
			</div>
		</div>
		<divid="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div>
				<div>
					<div>
						<button type="button"data-dismiss="modal" aria-hidden="true">&times;</button>
						<divid="myModalLabel">请输入登录密码:</div>
					</div>
					<div>
						<div>
							<input id="input-text" type="text" value=""placeholder="">
						</div>
						<button type="button" id="btn-ok">确定撤单</button>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
<script type="text/javascript">
	function operateFormatter(value, row, index) {
		return [
			''<button type="button"data-toggle="modal" data-target="#myModal">撤单</button>''
		].join('''');
	}
	window.operateEvents = {
		''click .RoleOfdelete'': function(e, value, row, index) {
			console.log(''kkk'');
		}
	};
	$(''#table'').bootstrapTable({
		url: '''', //请求后台的URL(*)
		method: ''GET'', //请求方式(*)
		// toolbar: ''#toolbar'', //工具按钮用哪个容器
		cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
		pagination: false, //是否显示分页(*)
		// pageSize: 10, //每页的记录行数(*)
		// pageNumber: 1, //初始化加载第一页,默认第一页,并记录
		// sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
		uniqueId: "id", //每一行的唯一标识,一般为主键列
		columns: [{
				field: ''id'',
				align: ''center'',
				title: ''交易合同号''
			},
			{
				field: ''ida'',
				align: ''center'',
				title: ''客户编号''
			},
			{
				field: ''idb'',
				align: ''center'',
				title: ''客户姓名''
			},
			{
				field: ''idc'',
				align: ''center'',
				title: ''手机号码''
			},
			{
				field: ''idd'',
				align: ''center'',
				title: ''证件号码''
			},
			{
				field: ''ide'',
				align: ''center'',
				title: ''产品代码''
			},
			{
				field: ''idf'',
				align: ''center'',
				title: ''产品名称''
			},
			{
				field: ''idg'',
				align: ''center'',
				title: ''购买金额''
			},
			{
				field: ''idh'',
				align: ''center'',
				title: ''交易时间''
			},
			{
				field: ''idi'',
				align: ''center'',
				title: ''撤单'',
				events: operateEvents,
				formatter: operateFormatter
			},
		],
		data: [{
				id: 1
			},
			{
				id: 1
			},
			{
				id: 1
			}
		],
		onLoadError: function() {
			showTips("数据加载失败!");
		},

	});
	$(''#table-ta-one'').bootstrapTable({
		url: '''', //请求后台的URL(*)
		method: ''GET'', //请求方式(*)
		// toolbar: ''#toolbar'', //工具按钮用哪个容器
		cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
		pagination: false, //是否显示分页(*)
		// pageSize: 10, //每页的记录行数(*)
		// pageNumber: 1, //初始化加载第一页,默认第一页,并记录
		// sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
		uniqueId: "id", //每一行的唯一标识,一般为主键列
		columns: [{
				field: ''id'',
				align: ''center'',
				title: ''交易合同号''
			},
			{
				field: ''ida'',
				align: ''center'',
				title: ''客户编号''
			},
			{
				field: ''idb'',
				align: ''center'',
				title: ''客户姓名''
			},
			{
				field: ''idc'',
				align: ''center'',
				title: ''手机号码''
			},
			{
				field: ''idd'',
				align: ''center'',
				title: ''证件号码''
			},
			{
				field: ''ide'',
				align: ''center'',
				title: ''产品代码''
			},
			{
				field: ''idf'',
				align: ''center'',
				title: ''产品名称''
			},
			{
				field: ''idg'',
				align: ''center'',
				title: ''购买金额''
			},
			{
				field: ''idh'',
				align: ''center'',
				title: ''交易时间''
			}
		],
		data: [{
				id: 1
			},
			{
				id: 1
			},
			{
				id: 1
			}
		],
		onLoadError: function() {
			showTips("数据加载失败!");
		},

	});
	$(''#btn-one'').click(function() {
		console.log(''kk'');
		$(''#table-one'').show();
		$(''#table-two'').hide();
		$(''#btn-one'').css({
			''background-color'': ''#e6e6e6''
		})
	})
	$(''#btn-two'').click(function() {
		console.log(''kkk'');
		$(''#table-two'').show();
		$(''#table-one'').hide();
		$(''#btn-one'').css({
			''background-color'': ''#FFF''
		})
	})
	$(''#pageLimit'').bootstrapPaginator({
		currentPage: 1, //当前的请求页面。
		totalPages: 100, //一共多少页。
		size: "normal", //应该是页眉的大小。
		bootstrapMajorVersion: 3, //bootstrap的版本要求。
		alignment: "right",
		numberOfPages: 5, //一页列出多少数据。
		itemTexts: function(type, page, current) { //如下的代码是将页眉显示的中文显示我们自定义的中文。
			switch (type) {
				case "first":
					return "首页";
				case "prev":
					return "上一页";
				case "next":
					return "下一页";
				case "last":
					return "末页";
				case "page":
					return page;
			}
		}
	});
	$(''#pageLimit-two'').bootstrapPaginator({
		currentPage: 1, //当前的请求页面。
		totalPages: 100, //一共多少页。
		size: "normal", //应该是页眉的大小。
		bootstrapMajorVersion: 3, //bootstrap的版本要求。
		alignment: "right",
		numberOfPages: 5, //一页列出多少数据。
		itemTexts: function(type, page, current) { //如下的代码是将页眉显示的中文显示我们自定义的中文。
			switch (type) {
				case "first":
					return "首页";
				case "prev":
					return "上一页";
				case "next":
					return "下一页";
				case "last":
					return "末页";
				case "page":
					return page;
			}
		}
	});
	$(''#btn-ok'').click(function() {
		var inputContent = $(''#input-text'').val();
		if (inputContent == '''') {
			alert(''密码不能为空 !'');
		}
		console.log(inputContent);
	})
</script>

 

Bootstrap css在navbar navbar-fixed-top下面隐藏容器部分

我正在建立一个项目与Bootstrap和im面对小问题。我有一个容器下面的Navtoptop.My问题是我的容器的一些部分隐藏在nav-top标题下。我不想使用顶部边距容器。 pls见下面的html,其中im面对的问题
<html>
<head>
<Meta name="viewport" content="width=device-width" />
<title>Index</title>
<link rel="stylesheet" href="~/stylesheets/bootstrap.css"/>
<link rel="stylesheet" href="~/stylesheets/bootstrap-responsive.css"/>

</head>
<body>
    <div>
        <div>
            <div>
           <button data-target=".nav-collapse" data-toggle="collapse"type="button">
            <span></span>
            <span></span>
            <span></span>
          </button>
                <div><ulid="navbar"><li ng-><a href="/plunks/trending"><i></i>Home</a></li><li><a target="_self" href="/edit/"><i></i>General Election 2014</a></li><li>
                    </li><li><ahref="#" data-toggle="dropdown">
                        <i>
                        </i>Assembly Elections
                        <b></b>
                        </a>
                        <ul>
                                <li><a href="#/HTML5Apps">Assembly Elections 2013</a></li>
                        </ul>
                         </li><li>
                    </li><li ng-><a href="/tags"><i></i>Constituecy</a></li><li ng-https://www.jb51.cc/tag/dis/" target="_blank">discuss'}"><a href="/discuss"><i></i>Election News</a></li><li></li><li><a href="https://github.com/filearts/plunker"><i></i>Candidate</a></li></ul></div>
             </div>
         </div>
    </div>
  <div>
   <ul>
    <li>
    <a href="#">Popular</a>
    </li>
    <li><a href="#">Trending</a></li>
    <li><a href="#">Latest</a></li>
    </ul>
   </div>

    <script src="~/Scripts/jquery.js"></script>
    <script src="~/Scripts/bootstrap-dropdown.js"></script>
    <script src="~/Scripts/Collapse.js"></script>
</body>
</html>

解决方法

这是通过向< body>的顶部添加一些填充来处理的。

根据Bootstrap’s documentation on .navbar-fixed-top,尝试自己的值或使用我们的代码段下面。提示:默认情况下,导航栏高度为50像素。

body {
    padding-top: 70px;
  }

另外,看看this example的源代码,打开starter-template.css

bootstrap jquery.slimscroll

bootstrap jquery.slimscroll

总结

以上是小编为你收集整理的bootstrap jquery.slimscroll全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

Bootstrap 抛出未捕获的错误:Bootstrap 的 JavaScript 需要 jQuery

Bootstrap 抛出未捕获的错误:Bootstrap 的 JavaScript 需要 jQuery

我正在尝试使用 Bootstrap 为程序制作界面。我在标签中添加了 jQuery
1.11.0<head>并认为就是这样,但是当我在浏览器中启动网页时,jQuery 报告了一个错误:

Uncaught Error: Bootstrap''s JavaScript requires jQuery

我尝试过使用 jQuery 1.9.0,我尝试过使用托管在多个 CDN 上的副本,但我无法让它工作。谁能指出我做错了什么?

答案1

小编典典

尝试这个

更改文件的顺序应该如下所示..

<script src="js/jquery-1.11.0.min.js"></script><script src="js/bootstrap.min.js"></script><script src="js/wow.min.js"></script>

今天的关于jquery – 尝试使用bootstrap navbar品牌和scrollTop()的分享已经结束,谢谢您的关注,如果想了解更多关于bootstrap + bootstrap-table + jquery + bootstrap-paginator、Bootstrap css在navbar navbar-fixed-top下面隐藏容器部分、bootstrap jquery.slimscroll、Bootstrap 抛出未捕获的错误:Bootstrap 的 JavaScript 需要 jQuery的相关知识,请在本站进行查询。

本文标签: