This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Administrator on 2016/12/12. | |
*/ | |
; | |
(function () { | |
//暴露外部使用一个接口 | |
var _$ = window.$; | |
var _jQuery = window.jQuery; | |
var jQuery = window.jQuery = window.$ = function (selector) { | |
return jQuery.fn.init(selector);//这样就可以$('div')得到了一个new 出来的实例 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
盒子模型属性: | |
* clientWidth : 内容+左右padding | |
* clientHeight : 内容+上下padding | |
* clientLeft : 左边框的宽度 | |
* clientTop : 上边框的宽度 | |
* | |
* offsetWidth : clientWidth + 左右border | |
* offsetHeight : clientHeight + 上下border | |
* offsetParent : offsetParent的值要取决于上一级节点是否包含定位属性。然而这个定位的值必须是(relative,absolute,fixed)。如果上一级元素不包含定位属性,那么再继续向上查找,如果查找到body仍然没有。那么默认就是body。 | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>获取元素距离body的偏移量(无论offsetParent是谁)</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div id="result"> | |
</div> | |
<img src="" alt="" id="pic"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<script src="angular.js"> | |
</script> | |
<body ng-app="myApp" ng-controller="firstController"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="../../vendor/bootstrap3/css/bootstrap.min.css"/> | |
</head> | |
<body> | |
<div ng-app="myApp" style="margin-top: 100px;"> | |
<form name="myForm" action="kittencup.php" ng-controller="firstController" class="container form-horizontal"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style type="text/css"> | |
#code { | |
width: 100px; | |
height: 50px; | |
line-height: 50px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
html,body{ | |
padding:0; | |
margin: 0; | |
font-size: 14px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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" /> | |
<title>无标题文档</title> | |
<style> | |
* { padding: 0; margin: 0; } | |
li { list-style: none; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> | |
<style> | |
#div1 {width:100px; height:100px; background:red; position:absolute; top:50px; left:0;} | |
</style> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>无标题文档</title> | |
<script> | |
var iSpeed=0; |