summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/JQTouch/extensions/jqt.floaty.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/JQTouch/extensions/jqt.floaty.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/JQTouch/extensions/jqt.floaty.js96
1 files changed, 0 insertions, 96 deletions
diff --git a/frontend/gamma/js/JQTouch/extensions/jqt.floaty.js b/frontend/gamma/js/JQTouch/extensions/jqt.floaty.js
deleted file mode 100644
index c7e4485..0000000
--- a/frontend/gamma/js/JQTouch/extensions/jqt.floaty.js
+++ b/dev/null
@@ -1,96 +0,0 @@
1/*
2
3 _/ _/_/ _/_/_/_/_/ _/
4 _/ _/ _/ _/_/ _/ _/ _/_/_/ _/_/_/
5 _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
6 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
7 _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/ _/
8 _/
9 _/
10
11 Created by David Kaneda <http://www.davidkaneda.com>
12 Documentation and issue tracking on Google Code <http://code.google.com/p/jqtouch/>
13
14 Special thanks to Jonathan Stark <http://jonathanstark.com/>
15 and pinch/zoom <http://www.pinchzoom.com/>
16
17 (c) 2009 by jQTouch project members.
18 See LICENSE.txt for license.
19
20*/
21
22(function($) {
23 if ($.jQTouch)
24 {
25 $.jQTouch.addExtension(function Floaty(jQT){
26
27 $.fn.makeFloaty = function(options){
28 var defaults = {
29 align: 'top',
30 spacing: 20,
31 time: '.3s'
32 };
33
34 var settings = $.extend({}, defaults, options);
35
36 settings.align = (settings.align == 'top') ? 'top' : 'bottom';
37
38 return this.each(function(){
39 var $el = $(this);
40
41 $el.css({
42 '-webkit-transition': 'top ' + settings.time + ' ease-in-out',
43 'display': 'block',
44 'min-height': '0 !important'
45 }).data('settings', settings);
46
47 $(document).scroll(function(){
48 if ($el.data('floatyVisible') === 'true')
49 {
50 $el.scrollFloaty();
51 }
52 });
53 $el.scrollFloaty();
54 });
55 };
56
57 $.fn.scrollFloaty = function(){
58
59
60 return this.each(function(){
61 var $el = $(this);
62 var settings = $el.data('settings'); // Settings not being set as object w/Zepto
63 var wHeight = $('html').attr('clientHeight'); // WRONG
64
65 var newY = window.pageYOffset +
66 ((settings.align == 'top') ?
67 settings.spacing : wHeight - settings.spacing - $el.get(0).offsetHeight);
68
69 $el.css('top', newY).data('floatyVisible', true);
70 });
71 };
72
73 $.fn.hideFloaty = function(){
74 return this.each(function(){
75 var $el = $(this);
76 var oh = $el.get(0).offsetHeight;
77
78 $el.css('top', -oh-10).data('floatyVisible', false);
79 });
80 };
81
82 $.fn.toggleFloaty = function(){
83 return this.each(function(){
84 var $el = $(this);
85 if ($el.data('floatyVisible') === 'true'){
86 $el.hideFloaty();
87 }
88 else
89 {
90 $el.scrollFloaty();
91 }
92 });
93 };
94 });
95 }
96})($); \ No newline at end of file