Skip to content

Commit 9717b46

Browse files
committed
test
1 parent 8244eda commit 9717b46

File tree

5 files changed

+77
-4
lines changed

5 files changed

+77
-4
lines changed

common/test.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<head>
44
<meta charset="utf-8"/>
55
<title>test</title>
6+
<link rel="stylesheet" type="text/css" href="../css/common.css"/>
7+
<link rel="stylesheet" type="text/css" href="../css/pop.css"/>
8+
69
</head>
710
<body>
811
<div>111</div>
@@ -25,7 +28,12 @@
2528
var p = new $.pop({
2629

2730
});
31+
(function (window){
32+
33+
(function(w){
2834

35+
})(window);
36+
})(window)
2937

3038

3139

css/common.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ textarea{border-radius:3px;}
8484
/* pop */
8585
.pop-wrap{position:fixed;top:30px;left:30px;width:700px;height:400px;background:#fff;box-shadow:0 22px 50px -35px #000;z-index:2000;}
8686
.pop-close{position:absolute;top:6px;right:18px;font-family:'Microsoft YaHei';font-size:25px;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:0.2;cursor:pointer;}
87-
.pop-close:hover{text-decoration:none;filter:alpha(opacity=40);opacity:1;color:0;color:#000;}
87+
.pop-close:hover{text-decoration:none;filter:alpha(opacity=40);opacity:1;color:#000;}
8888
.ui-mask{position:absolute;left:0;top:0;z-index:777;background:#000;filter:alpha(opacity=50);opacity:0.5;zoom:1;}
8989
.pop-title{width:100%;height:60px;cursor:move;}
9090
.pop-main{padding:20px;text-align:center;}

css/pop.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.ui-pop{position:fixed;min-width:150px;border:10px solid #4b4b4b;background:#fff;overflow:hidden;z-index:99999;}
2+
.ui-pop h1{*margin-top:-3px;position:relative; text-indent:1em;padding:10px 0;font-size:14px;font-weight:normal;background:#efefef;border-bottom:1px solid #ccc;-moz-user-select:none;/* FF禁止选择文字 */-webkit-user-select:none;/* Chrome禁止选择文字 */}
3+
.ui-pop h1 .ui-closeWin{position:absolute;right:10px;cursor:pointer;text-indent:0;}
4+
.ui-pop h1 .ui-maxwin{position:absolute;right:50px;cursor:pointer;}
5+
.ui-win-body{padding:10px;line-height:23px;}
6+
.ui-win-footer{background:#f6f6f6;border-top:1px solid #dadee5;padding:5px;text-align:right;white-space:nowrap;}
7+
.ui-win-footer button{border:1px solid #999;color:#333;cursor:pointer;margin-left:15px;padding:5px 8px;text-align:center;display:inline-block;}
8+
.ui-mask{position:absolute;left:0;top:0;z-index:77777;background:#fff;filter:alpha(opacity=50);opacity:0.5;cursor:pointer;}
9+
.in{margin:50px auto;width:90px;}
10+
.tab{border-collapse:collapse;border:1px solid #ccc;}
11+
.tab td{border:1px solid #ccc;padding:2px;}
12+
.ctr{height:800px;}
13+
/* 模拟IE6 position:fix的效果 From: http://www.blueidea.com/tech/web/2010/7665.asp */
14+
*html{background:url(*) fixed;}
15+
*html body{margin:0;height:100%;}

js/jing.js

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,30 @@
348348
* @returns {*}
349349
*/
350350
_.access = function(elems, fn, key, value, chainable, emptyGet, raw){
351+
var i = 0,
352+
length = elems.length,
353+
bulk = key = null;
354+
355+
if($.type(key) === 'object'){ // 传递参数如{ name : 'jikey', age : 30 }
356+
chainable = true;
357+
for(i in key){
358+
_.access(elems, fn, i, key[i], true, emptyGet, raw);
359+
}
360+
} else if(value !== undefined){
361+
chainable = true;
362+
363+
if(!$.isFunction(value)){
364+
raw = true;
365+
}
366+
367+
if(fn){
368+
for(; i < length; i++){
369+
fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
370+
}
371+
}
372+
}
351373

352-
return elems;
374+
return chainable ? elems : bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet;
353375
}
354376
// DOM常规操作
355377
$.fn.extend({
@@ -601,7 +623,7 @@
601623
}
602624
$.browser = browser;
603625

604-
// css相关静态方法
626+
// css静态方法
605627
$.extend({
606628
cssHooks : function(){
607629

@@ -620,6 +642,26 @@
620642
}
621643
});
622644

645+
_.isHidden = function(elem, el){
646+
elem = el || elem;
647+
return $.css(elem, 'display') === 'none';
648+
}
649+
// css原型方法
650+
$.fn.extend({
651+
css : function(name, value){
652+
653+
},
654+
show : function(){
655+
656+
},
657+
hide : function(){
658+
659+
},
660+
toggle : function(){
661+
662+
}
663+
});
664+
623665
// 检测相关
624666
(function(){
625667
var a = null,

js/pop.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
$.pop.prototype = {
2121
init : function(options){
2222
this.create();
23+
this.mask();
2324
},
2425
create : function(){
2526
var defaults = this.defaults,
@@ -28,7 +29,7 @@
2829
pop = null,
2930
wrap = null;
3031

31-
pop = $('<div class="pop" />').appendTo('body').html('<p>春来江水鸭先知</p>');
32+
pop = $('<div class="ui-pop"><h1 class="ui-win-title">消息<a class="ui-closeWin" href="javascript:void(0)">关闭</a></h1><p>春来江水鸭先知1</p></div>').appendTo('body');
3233
console.log(pop);
3334
/*
3435
wrap = handler.wrap = $.html('section', { class : 'pop-wrap' });
@@ -48,6 +49,13 @@
4849

4950
// $.css(handler.wrap, { position : 'absolute',width: '100px'});
5051
// console.log($.css(handler.wrap, 'width'));
52+
},
53+
mask : function(){
54+
var m = null,
55+
defaults = this.defaults,
56+
handler = this.handler;
57+
58+
m = $('<div class="ui-mask"></div>').appendTo('body');
5159
}
5260
}
5361
}(window, Jing));

0 commit comments

Comments
 (0)