Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit24a8c1f

Browse files
author
Ray Stone
committed
first-commit
0 parents  commit24a8c1f

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

‎README‎

Whitespace-only changes.

‎jquery.leanModal.js‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
(function($){
2+
3+
$.fn.extend({
4+
5+
leanModal:function(options){
6+
7+
vardefaults={
8+
top:100,
9+
overlay:0.5
10+
}
11+
12+
options=$.extend(defaults,options);
13+
14+
returnthis.each(function(){
15+
16+
varo=options;
17+
18+
$(this).click(function(e){
19+
20+
varoverlay=$("<div id='lean_overlay'></div>");
21+
22+
varmodal_id=$(this).attr("href");
23+
24+
$("body").append(overlay);
25+
26+
$("#lean_overlay").click(function(){
27+
close_modal(modal_id);
28+
});
29+
30+
varmodal_height=$(modal_id).outerHeight();
31+
varmodal_width=$(modal_id).outerWidth();
32+
33+
$('#lean_overlay').css({'display' :'block',opacity :0});
34+
35+
$('#lean_overlay').fadeTo(200,o.overlay);
36+
37+
$(modal_id).css({
38+
39+
'display' :'block',
40+
'position' :'fixed',
41+
'opacity' :0,
42+
'z-index':11000,
43+
'left' :50+'%',
44+
'margin-left' :-(modal_width/2)+"px",
45+
'top' :o.top+"px"
46+
47+
});
48+
49+
$(modal_id).fadeTo(200,1);
50+
51+
e.preventDefault();
52+
53+
});
54+
55+
});
56+
57+
functionclose_modal(modal_id){
58+
59+
$("#lean_overlay").fadeOut(200);
60+
61+
$(modal_id).css({'display' :'none'});
62+
63+
}
64+
65+
}
66+
});
67+
68+
})(jQuery);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp