首页 > Web开发 > 详细

9.27js拓展、bootstrap菜鸟教程

时间:2016-09-27 13:19:30      阅读:187      评论:0      收藏:0      [点我收藏+]

js(点击挂上 与 点击移除)

<div id="dd" style="width:200px; height:200px; background-color:#669">
这是一个层
</div>

<span onclick="a()">点击挂上事件</span>
<span onclick="b()">点击移除事件</span>

 

<script type="text/javascript">
function showdd()            这里的showdd自定义
{
  alert("被点中了");
}


function a()
{
  var d = document.getElementById("dd");
  d.onclick = function (){showdd()};       这里的 function (){showdd()} 为匿名函数,大括号里填写要执行的代码
}


function b()
{
  var d = document.getElementById("dd");
  d.onclick = function (){};         匿名函数为空
}

</script>

 

 

bootstrap:(响应式设计:Bootstrap 的响应式 CSS 能够自适应于台式机、平板电脑和手机)

http://www.runoob.com/bootstrap/bootstrap-navbar.html  关联网页

 

在head里面添加:

<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">  通常写title上面

 

<link href="../bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" type="text/css" />     核心css文件

<script src="../bootstrap/dist/js/jquery-1.11.2.min.js"></script>          核心jquery文件

<script src="../bootstrap/dist/js/bootstrap.min.js"></script>              核心js文件

 这里的link href 与 script src 是样式插入地址

9.27js拓展、bootstrap菜鸟教程

原文:http://www.cnblogs.com/u1020641/p/5912244.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!