tnblog
首页
视频
资源
登录
什么时候才能领悟,取之越多失之越多
排名
5
文章
229
粉丝
15
评论
7
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:50010702506256
欢迎加群交流技术

bootstrap实现一个简单的图书显示

3916人阅读 2020/2/22 20:52 总访问:1166315 评论:0 收藏:0 手机
分类: 前端

效果如下:


代码:

代码:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8" />
  5.     <title>首页-智能听书网</title>
  6.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.     <meta content="width=device-width, initial-scale=1" name="viewport" />
  8.     <meta content="" name="description" />
  9.     <meta content="" name="author" />
  10.     <!-- BEGIN GLOBAL MANDATORY STYLES -->
  11.     <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" />
  12.     <link href="~/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  13.     <link href="~/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
  14.     <link href="~/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  15.     <link href="~/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" />
  16.     <link href="~/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
  17.     <!-- END GLOBAL MANDATORY STYLES -->
  18.     <!-- BEGIN THEME GLOBAL STYLES -->
  19.     <link href="~/assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
  20.     <link href="~/assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
  21.     <!-- END THEME GLOBAL STYLES -->
  22.     <!-- BEGIN THEME LAYOUT STYLES -->
  23.     <link href="~/assets/layouts/layout3/css/layout.min.css" rel="stylesheet" type="text/css" />
  24.     <link href="~/assets/layouts/layout3/css/themes/default.min.css" rel="stylesheet" type="text/css" id="style_color" />
  25.     <link href="~/assets/layouts/layout3/css/custom.min.css" rel="stylesheet" type="text/css" />
  26.     <script src="~/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
  27.     <!-- END THEME LAYOUT STYLES -->
  28.     <link rel="shortcut icon" href="~/favicon.ico" />
  29.     <script src="~/Content/layer/layer.js"></script>
  30.     <script>
  31.         //dom加载完成
  32.         $(function ({
  33.             //单击事件
  34.             $(".clickdetails").click(function ({
  35.                 //找到自己的div
  36.                 var my = $(this);
  37.                 //获取书名
  38.                 var bookname = my.children("div").eq(1).html();
  39.                 var content = my.children("div").eq(2).html();;
  40.                 layer.open({
  41.                     title"书籍详情",
  42.                     area: ["580px""410px"],
  43.                     content"书名:" + bookname + "<div style='margin-top:9px'>简介:" + content + "</div><div style='margin-top:9px'>听书:<a href='#' style='color'>播放</a></div>"
  44.                 });
  45.             });
  46.             $("#searchBut").click(function ({
  47.                 //获取需要收搜的书名
  48.                 var bookname = $("#search").val();
  49.                 //if (bookname == null || bookname == "") {
  50.                 //    alert("请输入搜索内容");
  51.                 //}
  52.                 location.href = "/book/index?bookName=" + bookname;
  53.             });
  54.         });
  55.     </script>
  56. </head>
  57. @model List<Model.Books>
  58. <!-- END HEAD -->
  59. <body class="page-container-bg-solid page-boxed">
  60.     <!-- BEGIN HEADER -->
  61.     <div>
  62.         <!-- BEGIN HEADER TOP -->
  63.         <div>
  64.             <div>
  65.                 <!-- BEGIN LOGO -->
  66.                 <div>
  67.                     <a href="index.html">
  68.                         <img src="~/img/book.png" style="height:40px;margin-top:20px" alt="logo">
  69.                     </a>
  70.                 </div>
  71.                 <!-- END LOGO -->
  72.                 <!-- BEGIN RESPONSIVE MENU TOGGLER -->
  73.                 <a href="javascript:;"></a>
  74.                 <!-- END RESPONSIVE MENU TOGGLER -->
  75.                 <!-- BEGIN TOP NAVIGATION MENU -->
  76.                 <div>
  77.                     <ul class="nav navbar-nav pull-right">
  78.                         @if (Session["username"] == null)
  79.                         {
  80.                             <li class="dropdown dropdown-user dropdown-dark">
  81.                                 <a href="/login/index" >
  82.                                     <span class="username username-hide-mobile">登录</span>
  83.                                 </a>
  84.                             </li>
  85.                         }
  86.                         else
  87.                         {
  88.                             <li class="dropdown dropdown-user dropdown-dark">
  89.                                 <a href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
  90.                                     @*<img alt="" src="~/assets/layouts/layout3/img/avatar9.jpg">*@
  91.                                     <span class="username username-hide-mobile">@Session["username"]</span>
  92.                                 </a>
  93.                                 <ul class="dropdown-menu dropdown-menu-default">
  94.                                     <li>
  95.                                         <a href="/user/index">
  96.                                             <i></i>个人中心
  97.                                         </a>
  98.                                     </li>
  99.                             </li>
  100.                             <li>
  101.                                 <a href="/login/index">
  102.                                     <i></i>退出登录
  103.                                 </a>
  104.                             </li>
  105.                         }
  106.                     </ul>
  107.                     @*</ul>*@
  108.                 </div>
  109.                 <!-- END TOP NAVIGATION MENU -->
  110.             </div>
  111.         </div>
  112.         <!-- END HEADER TOP -->
  113.         <!-- BEGIN HEADER MENU -->
  114.         <div>
  115.             <div>
  116.                 <!-- BEGIN HEADER SEARCH BOX -->
  117.                 <form action="page_general_search.html" method="GET">
  118.                     <div>
  119.                         <input type="text" value="@ViewBag.bookName" id="search" placeholder="Search" name="query">
  120.                         <span>
  121.                             <a href="javascript:;" id="searchBut">
  122.                                 <i></i>
  123.                             </a>
  124.                         </span>
  125.                     </div>
  126.                 </form>
  127.                 <div class="hor-menu  ">
  128.                     <ul class="nav navbar-nav">
  129.                         <li class="menu-dropdown active classic-menu-dropdown ">
  130.                             <a href="javascript:;">
  131.                                 首页
  132.                                 <span></span>
  133.                             </a>
  134.                             @*<ul class="dropdown-menu pull-left">
  135.                                     <li class=" ">
  136.                                         <a href="index.html" class="nav-link  ">
  137.                                             <i></i>听书
  138.                                             <span class="badge badge-success">1</span>
  139.                                         </a>
  140.                                     </li>
  141.                                     <li class=" ">
  142.                                         <a href="dashboard_2.html" class="nav-link  ">
  143.                                             <i></i> Dashboard 2
  144.                                         </a>
  145.                                     </li>
  146.                                     <li class=" ">
  147.                                         <a href="dashboard_3.html" class="nav-link  ">
  148.                                             <i></i> Dashboard 3
  149.                                             <span class="badge badge-danger">3</span>
  150.                                         </a>
  151.                                     </li>
  152.                                 </ul>*@
  153.                         </li>
  154.                         <li class="menu-dropdown mega-menu-dropdown  ">
  155.                             <a href="javascript:;">
  156.                                 商城
  157.                                 <span></span>
  158.                             </a>
  159.                         </li>
  160.                         <li class="menu-dropdown mega-menu-dropdown  mega-menu-full">
  161.                             <a href="javascript:;">
  162.                                 精品
  163.                                 <span></span>
  164.                             </a>
  165.                         </li>
  166.                         <li class="menu-dropdown classic-menu-dropdown">
  167.                             <a href="javascript:;">
  168.                                 热点
  169.                                 <span></span>
  170.                             </a>
  171.                         </li>
  172.                         <li class="menu-dropdown mega-menu-dropdown  mega-menu-full">
  173.                             <a href="javascript:;">
  174.                                 圈子
  175.                                 <span></span>
  176.                             </a>
  177.                         </li>
  178.                         <li class="menu-dropdown classic-menu-dropdown ">
  179.                             <a href="javascript:;">
  180.                                 关于
  181.                                 <span></span>
  182.                             </a>
  183.                         </li>
  184.                     </ul>
  185.                 </div>
  186.                 <!-- END MEGA MENU -->
  187.             </div>
  188.         </div>
  189.         <!-- END HEADER MENU -->
  190.     </div>
  191.     <!-- END HEADER -->
  192.     <!-- BEGIN CONTAINER -->
  193.     <div>
  194.         <!-- BEGIN CONTENT -->
  195.         <div>
  196.             <div>
  197.                 <div>
  198.                     <!-- BEGIN PAGE BREADCRUMBS -->
  199.                     @*<ul class="page-breadcrumb breadcrumb">
  200.                             <li>
  201.                                 <a href="index.html">Home</a>
  202.                                 <i class="fa fa-circle"></i>
  203.                             </li>
  204.                             <li>
  205.                                 <span>Layouts</span>
  206.                             </li>
  207.                         </ul>*@
  208.                     <!-- END PAGE BREADCRUMBS -->
  209.                     <!-- BEGIN PAGE CONTENT INNER -->
  210.                     @*<div>
  211.                             <div class="note note-info">
  212.                                 <p> A black page template with a minimal dependency assets to use as a base for any custom page you create </p>
  213.                             </div>
  214.                         </div>*@
  215.                     <div style="margin-top:20px">
  216.                         <div>
  217.                             @foreach (var book in Model)
  218.                             {
  219.                                 <div class="col-md-3 col-sm-3 col-xs-6">
  220.                                     <div class="color-demo tooltips clickdetails" data-original-title="点击查看详情" data-toggle="modal" data-target="#demo_modal_white">
  221.                                         <div class="color-view bg-white bg-font-white bold uppercase" style="padding:10px 0px">
  222.                                             <img src="~/img/books/@book.Img" style="max-width:150px" />
  223.                                         </div>
  224.                                         <div class="color-info bg-white c-font-14 sbold"> @book.BookName </div>
  225.                                         <div style="display:none">
  226.                                             @book.Content
  227.                                         </div>
  228.                                     </div>
  229.                                 </div>
  230.                             }
  231.                         </div>
  232.                         @*<div>
  233.                                 <div class="col-md-2 col-sm-2 col-xs-6">
  234.                                     <div class="color-demo tooltips" data-original-title="Click to view demos for this color" data-toggle="modal" data-target="#demo_modal_white">
  235.                                         <div class="color-view bg-white bg-font-white bold uppercase" style="padding:10px 0px">
  236.                                             <img src="~/img/books/ba1e6733b79147179cbff60327cec2b6.jpg" style="max-width:150px" />
  237.                                         </div>
  238.                                         <div class="color-info bg-white c-font-14 sbold"> 深度思考 </div>
  239.                                     </div>
  240.                                 </div>
  241.                                 <div class="col-md-2 col-sm-2 col-xs-6">
  242.                                     <div class="color-demo tooltips" data-original-title="点击查看关于这个颜色的demo" data-toggle="modal" data-target="#demo_modal_default">
  243.                                         <div class="color-view bg-default bg-font-default bold uppercase"> #e1e5ec </div>
  244.                                         <div class="color-info bg-white c-font-14 sbold"> default </div>
  245.                                     </div>
  246.                                 </div>
  247.                                 <div class="col-md-2 col-sm-2 col-xs-6">
  248.                                     <div class="color-demo tooltips" data-original-title="Click to view demos for this color" data-toggle="modal" data-target="#demo_modal_dark">
  249.                                         <div class="color-view bg-dark bg-font-dark bold uppercase"> #2f353b </div>
  250.                                         <div class="color-info bg-white c-font-14 sbold"> dark </div>
  251.                                     </div>
  252.                                 </div>
  253.                                 <div class="col-md-2 col-sm-2 col-xs-6">
  254.                                     <div class="color-demo tooltips" data-original-title="Click to view demos for this color" data-toggle="modal" data-target="#demo_modal_blue">
  255.                                         <div class="color-view bg-blue bg-font-blue bold uppercase"> #3598dc </div>
  256.                                         <div class="color-info bg-white c-font-14 sbold"> blue </div>
  257.                                     </div>
  258.                                 </div>
  259.                                 <div class="col-md-2 col-sm-2 col-xs-6">
  260.                                     <div class="color-demo tooltips" data-original-title="Click to view demos for this color" data-toggle="modal" data-target="#demo_modal_blue-madison">
  261.                                         <div class="color-view bg-blue-madison bg-font-blue-madison bold uppercase"> #578ebe </div>
  262.                                         <div class="color-info bg-white c-font-14 sbold"> blue-madison </div>
  263.                                     </div>
  264.                                 </div>
  265.                                 <div class="col-md-2 col-sm-2 col-xs-6">
  266.                                     <div class="color-demo tooltips" data-original-title="Click to view demos for this color" data-toggle="modal" data-target="#demo_modal_blue-chambray">
  267.                                         <div class="color-view bg-blue-chambray bg-font-blue-chambray bold uppercase"> #2C3E50 </div>
  268.                                         <div class="color-info bg-white c-font-14 sbold"> blue-chambray </div>
  269.                                     </div>
  270.                                 </div>
  271.                             </div>*@
  272.                     </div>
  273.                 </div>
  274.             </div>
  275.         </div>
  276.         <a href="javascript:;">
  277.             <i></i>
  278.         </a>
  279.     </div>
  280.     <div>
  281.         <div style="text-align:center">
  282.             智能听书网版权所有
  283.         </div>
  284.     </div>
  285.     <div>
  286.         <i></i>
  287.     </div>
  288.     <script src="~/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
  289.     <script src="~/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
  290.     <script src="~/assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
  291.     <script src="~/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
  292.     <script src="~/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
  293.     <script src="~/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
  294.     <script src="~/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
  295.     <script src="~/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
  296.     <script src="~/assets/global/scripts/app.min.js" type="text/javascript"></script>
  297.     <script src="~/assets/layouts/layout3/scripts/layout.min.js" type="text/javascript"></script>
  298.     <script src="~/assets/layouts/layout3/scripts/demo.min.js" type="text/javascript"></script>
  299.     <script src="~/assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
  300. </body>
  301. </html>


欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)

评价

bootstrap单选框重叠问题

从bootstrap模板中复制出来就有两个重叠的现象 看源码是生成了两次 重复生成了,所以boostrap那个模板中页面也...

bootstrap文字居中问题

静态页上面的效果是这样的可以看到文字和左边的下拉列表是居中的但是如果你直接复制过去可能就是这样的了我们来看看静态页...

bootstrap动态生成的单选框复选框等无法点击选中的问题

bootstrap的单选框、复选框是要经过渲染的,然后才显示出来的经过渲染的是这样的没有经过渲染的就是最原始的样子所以它的选...

bootstrap 栅格布局一小例子

效果很简单,就是显示一个头像与一个名字html:&lt;divclass=&quot;col-md-12&quot;style=&quot;margin-top:20px&quot;&gt;...

bootstrap内容灰白背景

其实就是page-container-bg-solid 样式加上右边内容就有灰色的背景效果如下如果不加就是全白的背景、如果需要根据不同的内...

bootstrap分页条样式

其实就是一个pagination即可&lt;divclass=&quot;dataTables_paginatepagination&quot;&gt; &lt;ulid=&quot;pagination&quo...

bootstrap模板 form的一点布局用法

bootstrap form的布局可以在form stuff里边看到,我们就复制form layouts里边的吧复制这里的我们实现一个简单的资源上传的页...

ASP.NET MVC + WebUploader+bootstrap实现文件上传进度条显示

引入需要的资源文件:&lt;scriptsrc=&quot;~/Content/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt; &lt;linkhref=&quot;...

bootstrap中的dataTables

就是这种直接支持页面分页,排序,搜索什么的注意需要相关的js和样式然后js把表格变成dataTable就可以了Bootstrap模板中使...

bootstrap 勾选不需要的列并记住状态

最近有个需求是要求记住这些没打勾的列因为不需要展示本来想建表去做一个状态选择,但是太麻烦了,会出现加载过慢的情况,...

bootstrap cdn地址

https://www.bootcdn.cn/simple-line-icons

bootstrap metronic模板中的一些页面固定菜单等

这个可以看到上边的一点菜单这种效果还是可以这个可以让左边的菜单支持滚动,但是好像效果并不是很好一样要实现整个菜单固...

bootstrap div垂直居中

code:&lt;!DOCTYPEhtml&gt; &lt;html&gt; &lt;head&gt; &lt;metacharset=&quot;UTF-8&quot;&gt; &lt;metaname=&quot;vi...

bootstrap表格样式

1、table-striped:斑马线表格2、table-bordered:带边框的表格3、table-hover:鼠标悬停高亮的表格前面三种组合在一起大概...

bootstrap一个不错的树形组件

先看看效果嘛,还是有点乖的,功能也算是比较强大,支持右键菜单,支持随意拖动。哈哈哈长得好看,还有内涵html:其实除了引...
大多数人高估了他们一天能做的事,但低估了他们一年能做的事。