jquery-lionbars 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .DS_Store
@@ -1,5 +1,5 @@
1
1
  module Jquery
2
2
  module Lionbars
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1 +1,417 @@
1
- (function(a){a.fn.lionbars=function(b,c,d,e){function F(b,c){var b=a(b);content=b.html();b.html("");b.append('<div class="nWrap" id="'+c+'"></div>');nWrap=b.find(".nWrap");a(nWrap).html(content);var d=b.css("padding-top");var e=b.css("padding-right");var f=b.css("padding-bottom");var g=b.css("padding-left");d=parseInt(d.replace("px",""));e=parseInt(e.replace("px",""));f=parseInt(f.replace("px",""));g=parseInt(g.replace("px",""));b.css({padding:0,width:b.width()+g+e,height:b.height()+d+f,overflow:"hidden",position:"relative"});nWrap.css({"padding-top":d,"padding-left":g,"padding-bottom":f,"padding-right":e,width:b.width()-g-e,height:b.height()-d-f})}function E(b){var c=new Array;var d=0;var b=a(b);var e,f;b.css({overflow:"auto"});b.prepend('<div class="nCheck"></div>');b.find(".nCheck").css({width:"100%",height:1,opacity:1,background:"red"});if(b.width()>b.find(".nCheck").width()){d=d+1;e=b.width()-b.find(".nCheck").width()}b.find(".nCheck").css({width:1,height:"100%"});if(b.height()>b.find(".nCheck").height()){d=d+2;f=b.height()-b.find(".nCheck").height()}b.find(".nCheck").remove();return[d,e,f]}function D(c,f,g,h){var i='<div class="scrollbar vertical nbar"></div><div class="scrollbar_bg vertical nbar"></div>';var j='<div class="scrollbar horizontal nbar"></div><div class="scrollbar_bg horizontal nbar"></div>';var c=a(c);var k=c.find(".nWrap");if(f==1){c.prepend(i);k.css({width:k.width()+g});k.addClass("vscroll")}if(f==2){c.prepend(j);k.css({height:k.height()+h});k.addClass("hscroll")}if(f==3){c.prepend(i);c.prepend(j);k.css({width:k.width()+g});k.css({height:k.height()+h});k.addClass("vscroll");k.addClass("hscroll")}var l=25;var m=c.find(".nWrap")[0].scrollHeight;var n=c.find(".nWrap")[0].scrollWidth;var o=c.height();var p=c.width();if(k.hasClass("vscroll")){n=n+15}if(k.hasClass("hscroll")){m=m+15}var h=o*(o/m);var g=p*(p/n);h=h<l?l:h;g=g<l?l:g;c.find(".scrollbar.vertical").css({height:h});c.find(".scrollbar.horizontal").css({width:g});if(k.hasClass("hscroll")){c.find(".scrollbar_bg.vertical").css({height:c.find(".scrollbar_bg.vertical").height()-13})}else{c.find(".scrollbar_bg.vertical").css({height:c.find(".scrollbar_bg.vertical").height()-4})}if(k.hasClass("vscroll")){c.find(".scrollbar_bg.horizontal").css({width:c.find(".scrollbar_bg.horizontal").width()-13})}else{c.find(".scrollbar_bg.horizontal").css({width:c.find(".scrollbar_bg.horizontal").width()-4})}if(b=="light"){c.find(".scrollbar").addClass("light");c.find(".scrollbar_bg").addClass("light")}else{c.find(".scrollbar").addClass("dark");c.find(".scrollbar_bg").addClass("dark")}if(d){c.find(".scrollbar").css({opacity:1})}if(e){c.find(".scrollbar_bg").css({opacity:1})}}function C(b){var b=a(b);var c=b.find(".nWrap");if(c.hasClass("hscroll")){var d=c.siblings(".scrollbar.vertical");var e=(b.height()-9-d.height()-2)/(c[0].scrollHeight-b.height())}else{var d=c.siblings(".scrollbar.vertical");var e=(b.height()-d.height()-2)/(c[0].scrollHeight-b.height())}c.attr("scrollfactorV",e);if(c.hasClass("vscroll")){var f=c.siblings(".scrollbar.horizontal");var g=(b.width()-9-f.width()-2)/(c[0].scrollWidth-b.width())}else{var f=c.siblings(".scrollbar.horizontal");var g=(b.width()-f.width()-2)/(c[0].scrollWidth-b.width())}c.attr("scrollfactorH",g)}function B(a,b,c,d,e,f,g,h,i,j,k){var l,m,n,o;if(a.hasClass("vertical")){o=g+k-i;m=o;m=m<2?2:m;m=m>a.siblings(".scrollbar_bg.vertical").height()-a.height()+2?a.siblings(".scrollbar_bg.vertical").height()-a.height()+2:m;a.css({top:m});b.scrollTop(o/d)}else{n=f+j-h;l=n;l=l<2?2:l;l=l>a.siblings(".scrollbar_bg.horizontal").width()-a.width()+2?a.siblings(".scrollbar_bg.horizontal").width()-a.width()+2:l;a.css({left:l});b.scrollLeft(n/e)}}var f=a(this);var g=0;f.each(function(){var b=a(this);var c=E(b);g+=1;if(c!=0){F(b,g);D(b,c[0],c[1],c[2]);C(b)}});var h,i,j,k;var l=false,m=0,n,o;var p=false,q=false,r,s,t,u,v,w,x,y;var z=false,A=true;a(".nWrap").mouseover(function(){if(c){a(this).siblings(".scrollbar").stop().animate({opacity:1},200)}});a(".nWrap").mouseout(function(){var b=a(this);if(!l&&!p){l=true;setTimeout(function(){m=0;l=false;if(c){a(".nbar").stop().animate({opacity:0},400)}if(!c&&d){b.siblings(".scrollbar_bg").stop().animate({opacity:0},400)}},1e3)}});a(".nWrap").scroll(function(b){if(!p){if(a(m).attr("id")!=a(this).attr("id")){m=a(this);if(!d){m.siblings(".scrollbar").stop().animate({opacity:1},200)}n=m.attr("scrollfactorV");o=m.attr("scrollfactorH");h=m.siblings(".scrollbar.vertical");i=m.siblings(".scrollbar.horizontal")}j=m.scrollTop()*n;j=j<2?2:j;h.css({top:j});k=m.scrollLeft()*o;k=k<2?2:k;i.css({left:k});if(!l&&!d){l=true;setTimeout(function(){m=0;l=false;a(".nbar").stop().animate({opacity:0},400)},1e3)}}});a(".scrollbar").mouseover(function(b){target=a(this);if(!e){target.siblings(".scrollbar_bg").stop().animate({opacity:1},400)}if(!d){target.add(target.siblings(".scrollbar")).stop().animate({opacity:1},400)}z=true});a(".scrollbar").mouseout(function(b){z=false;if(!l&&!p){l=true;setTimeout(function(){l=false;if(!z&&!d){a(".nbar").stop().animate({opacity:0},400)}else if(!z&&!e){a(".scrollbar_bg").stop().animate({opacity:0},400)}},1e3)}});a(".scrollbar").mousedown(function(b){b.preventDefault();p=true;r=a(this);v=b.pageX;w=b.pageY;t=a(this).position().left;u=a(this).position().top});a(document).mousemove(function(a){if(p&&!q){q=true;s=r.siblings(".nWrap");o=s.attr("scrollfactorh");n=s.attr("scrollfactorv")}if(p){x=a.pageX;y=a.pageY;B(r,s,a,n,o,t,u,v,w,x,y)}});a(document).mouseup(function(b){if(p){p=false;q=false;if(!l&&!p){l=true;setTimeout(function(){l=false;if(!z&&!d){a(".nbar").stop().animate({opacity:0},400)}else if(!z&&!e){a(".scrollbar_bg").stop().animate({opacity:0},400)}},1e3)}}});return this.each(function(){var b=a(this)})}})(jQuery)
1
+ (function( $ ) {
2
+ $.fn.hasScrollBar = function() {
3
+ return this.get(0).scrollHeight > this.height();
4
+ };
5
+ $.fn.lionbars = function(options) {
6
+ options = options || {};
7
+ autohide = options.autohide;
8
+
9
+ // Flags
10
+ var timeout,
11
+ HDragging=false,
12
+ VDragging=false,
13
+ activeScroll=0,
14
+ activeWrap=0,
15
+ eventX,
16
+ eventY,
17
+ mouseX,
18
+ mouseY,
19
+ currentRatio,
20
+ initPos,
21
+ scrollValue,
22
+ hideTimeoutSet=false,
23
+ vEventFired = false,
24
+ hEventFired = false;
25
+
26
+ // Initialization
27
+ var elements = $(this),
28
+ id = 0,
29
+ vScrollWidth=0, hScrollWidth=0,
30
+ addHScroll=false, addVScroll=false,
31
+ paddingTop=0, paddingLeft=0, paddingBottom=0, paddingRight=0,
32
+ borderTop=0, borderRight=0, borderBottom=0, borderLeft=0,
33
+ scrollHeight=0, scrollWidth=0, offsetWidth=0, offsetHeight=0, clientWidth=0, clientHeight=0,
34
+ vRatio=0, hRatio=0,
35
+ vSliderHeight=0, hSliderHeight=0,
36
+ vLbHeight=0, hLbHeight=0;
37
+
38
+ // Main Loop
39
+ mainLoop();
40
+
41
+ function mainLoop() {
42
+ for (var i=0; elements[i] !== undefined; i++) {
43
+ if (needScrollbars(elements[i]) && !$(elements[i]).hasClass('nolionbars')) {
44
+ // add the element to the main array
45
+ target = elements[i];
46
+
47
+ // get some values before the element is wrapped
48
+ getDimentions(target);
49
+
50
+ // wrap the element
51
+ wrap(target, addVScroll, addHScroll);
52
+
53
+ // hide the default scrollbar
54
+ hideScrollbars(target, addVScroll, addHScroll);
55
+
56
+ // Calculate the size of the scrollbars
57
+ reduceScrollbarsWidthHeight(target);
58
+ setSlidersHeight(target);
59
+
60
+ // Set variables needed to calculate scroll speed, etc.
61
+ setScrollRatios(target);
62
+
63
+ // Set events
64
+ setEvents(target);
65
+
66
+ // prepare for next element
67
+ resetVars();
68
+ }
69
+ }
70
+ }
71
+
72
+ // Set document events
73
+ $(document).mousemove(function(e) {
74
+ if (VDragging) {
75
+ mouseY = e.pageY;
76
+ activeWrap.scrollTop((initPos + mouseY - eventY) * Math.abs(currentRatio));
77
+ }
78
+ if (HDragging) {
79
+ mouseX = e.pageX;
80
+ activeWrap.scrollLeft((initPos + mouseX - eventX) * Math.abs(currentRatio));
81
+ }
82
+ });
83
+ $(document).mouseup(function(e) {
84
+ if (VDragging) {
85
+ VDragging = false;
86
+ }
87
+ if (HDragging) {
88
+ HDragging = false;
89
+ }
90
+ });
91
+
92
+ // Core functions
93
+ function setEvents(elem) {
94
+ var el = $(elem);
95
+
96
+ if (addVScroll || addHScroll) {
97
+ el.find('.lb-wrap').scroll(function(e) {
98
+ el.find('.lb-v-scrollbar-slider').css({ "top" : -$(this).scrollTop()/el.attr('vratio') });
99
+ el.find('.lb-h-scrollbar-slider').css({ "left" : -$(this).scrollLeft()/el.attr('hratio') });
100
+
101
+ if (el.find('.lb-v-scrollbar').height() == (parseInt(el.find('.lb-v-scrollbar-slider').css('top')) + el.find('.lb-v-scrollbar-slider').height())
102
+ && typeof(options.reachedBottom) == 'function'
103
+ && !vEventFired
104
+ ) {
105
+ vEventFired = true;
106
+ var self = $(this);
107
+
108
+ options.reachedBottom.apply($(this).children('.lb-content'), [function () {
109
+ getDimentions($(self).parent(), {
110
+ height: $(self).children('.lb-content').get(0).scrollHeight,
111
+ width: $(self).children('.lb-content').get(0).scrollWidth
112
+ });
113
+
114
+ // Calculate the size of the scrollbars
115
+ reduceScrollbarsWidthHeight($(self).parent());
116
+ setSlidersHeight($(self).parent());
117
+
118
+ // Set variables needed to calculate scroll speed, etc.
119
+ setScrollRatios($(self).parent());
120
+
121
+ // prepare for next element
122
+ resetVars();
123
+
124
+ vEventFired = false;
125
+ }]);
126
+ }
127
+
128
+ if (el.find('.lb-h-scrollbar').width() == (parseInt(el.find('.lb-h-scrollbar-slider').css('left')) + el.find('.lb-h-scrollbar-slider').width())
129
+ && typeof(options.reachedRight) == 'function'
130
+ && !hEventFired
131
+ ) {
132
+ hEventFired = true;
133
+ var self = $(this);
134
+
135
+ options.reachedRight.apply($(this).children('.lb-content'), [function () {
136
+ getDimentions($(self).parent(), {
137
+ height: $(self).children('.lb-content').get(0).scrollHeight,
138
+ width: $(self).children('.lb-content').get(0).scrollWidth
139
+ });
140
+
141
+ // Calculate the size of the scrollbars
142
+ reduceScrollbarsWidthHeight($(self).parent());
143
+ setSlidersHeight($(self).parent());
144
+
145
+ // Set variables needed to calculate scroll speed, etc.
146
+ setScrollRatios($(self).parent());
147
+
148
+ // prepare for next element
149
+ resetVars();
150
+
151
+ hEventFired = false;
152
+ }]);
153
+ }
154
+
155
+ if (autohide) {
156
+ el.find('.lb-v-scrollbar, .lb-h-scrollbar').fadeIn(150);
157
+ clearTimeout(timeout);
158
+ timeout = setTimeout(function() {
159
+ el.find('.lb-v-scrollbar, .lb-h-scrollbar').fadeOut(150);
160
+ }, 2000);
161
+ }
162
+ });
163
+ }
164
+
165
+ if (addVScroll) {
166
+ el.find('.lb-v-scrollbar-slider').mousedown(function(e) {
167
+ eventY = e.pageY;
168
+
169
+ VDragging = true;
170
+ activeScroll = $(this);
171
+ activeWrap = el.find('.lb-wrap');
172
+ currentRatio = activeWrap.parent().attr('vratio');
173
+ initPos = activeScroll.position().top;
174
+ return false;
175
+ });
176
+ el.find('.lb-v-scrollbar').mousedown(function(e) {
177
+ if (!$(e.target).hasClass('lb-v-scrollbar-slider')) {
178
+ el.find('.lb-wrap').scrollTop((e.pageY - $(this).offset().top) * Math.abs(el.attr('vratio')) - $(this).find('.lb-v-scrollbar-slider').height()/2);
179
+ }
180
+ return false;
181
+ });
182
+ }
183
+
184
+ if (addHScroll) {
185
+ el.find('.lb-h-scrollbar-slider').mousedown(function(e) {
186
+ eventX = e.pageX;
187
+
188
+ HDragging = true;
189
+ activeScroll = $(this);
190
+ activeWrap = el.find('.lb-wrap');
191
+ currentRatio = activeWrap.parent().attr('hratio');
192
+ initPos = activeScroll.position().left;
193
+ return false;
194
+ });
195
+ el.find('.lb-h-scrollbar').mousedown(function(e) {
196
+ if (!$(e.target).hasClass('lb-h-scrollbar-slider')) {
197
+ el.find('.lb-wrap').scrollLeft((e.pageX - $(this).offset().left) * Math.abs(el.attr('hratio')) - $(this).find('.lb-h-scrollbar-slider').width()/2);
198
+ }
199
+ return false;
200
+ });
201
+ }
202
+
203
+ if ((addVScroll || addHScroll) && autohide) {
204
+ el.find('.lb-v-scrollbar, .lb-h-scrollbar').hide();
205
+
206
+ el.hover(function() {
207
+ }, function() {
208
+ el.find('.lb-v-scrollbar, .lb-h-scrollbar').fadeOut(150);
209
+ });
210
+ }
211
+ }
212
+ function setScrollRatios(elem) {
213
+ vRatio = (offsetHeight - $(elem).find('.lb-wrap').get(0).scrollHeight - borderTop - borderBottom)/(vLbHeight - vSliderHeight);
214
+ hRatio = (offsetWidth - $(elem).find('.lb-wrap').get(0).scrollWidth - borderLeft - borderRight)/(hLbHeight - hSliderHeight);
215
+
216
+ var el = $(elem);
217
+ el.attr('vratio', vRatio);
218
+ el.attr('hratio', hRatio);
219
+ }
220
+ function setSlidersHeight(elem) {
221
+ var el = $(elem);
222
+ var hmin, hmax, gap;
223
+
224
+ if (el.find('.lb-v-scrollbar').length != 0) {
225
+ hmin = 20;
226
+ gap = offsetHeight - el.find('.lb-v-scrollbar').height();
227
+ hmax = offsetHeight - gap - hmin;
228
+ vSliderHeight = Math.round((offsetHeight*hmax)/scrollHeight);
229
+ vSliderHeight = (vSliderHeight < hmin) ? hmin : vSliderHeight;
230
+ }
231
+
232
+ if (el.find('.lb-h-scrollbar').length != 0) {
233
+ hmin = 20;
234
+ gap = offsetWidth - el.find('.lb-h-scrollbar').width();
235
+ hmax = offsetWidth - gap - hmin;
236
+ hSliderHeight = Math.round((offsetWidth*hmax)/scrollWidth);
237
+ hSliderHeight = (hSliderHeight < hmin) ? hmin : hSliderHeight;
238
+ }
239
+ el.find('.lb-v-scrollbar-slider').css({ "height" : vSliderHeight });
240
+ el.find('.lb-h-scrollbar-slider').css({ "width" : hSliderHeight });
241
+ }
242
+ function resetVars() {
243
+ vScrollWidth = 0;
244
+ hScrollWidth = 0;
245
+ addHScroll=false;
246
+ addVScroll=false;
247
+ paddingTop = 0;
248
+ paddingLeft = 0;
249
+ paddingBottom = 0;
250
+ paddingRight = 0;
251
+ borderTop = 0;
252
+ borderLeft = 0;
253
+ borderBottom = 0;
254
+ borderRight = 0;
255
+ scrollHeight = 0;
256
+ scrollWidth = 0;
257
+ offsetWidth = 0;
258
+ offsetHeight = 0;
259
+ clientWidth = 0;
260
+ clientHeight = 0;
261
+ // vRatio = 0;
262
+ // hRatio = 0;
263
+ vSliderHeight = 0;
264
+ hSliderHeight = 0;
265
+ vLbHeight = 0;
266
+ hLbHeight = 0;
267
+ }
268
+ function reduceScrollbarsWidthHeight(elem) {
269
+ var el = $(elem);
270
+
271
+ if (addVScroll && addHScroll) {
272
+ vLbHeight = el.height()-12;
273
+ hLbHeight = el.width()-12;
274
+ el.find('.lb-v-scrollbar').css({ "height" : vLbHeight });
275
+ el.find('.lb-h-scrollbar').css({ "width" : hLbHeight });
276
+ } else {
277
+ vLbHeight = el.height()-4;
278
+ hLbHeight = el.width()-4;
279
+ el.find('.lb-v-scrollbar').css({ "height" : vLbHeight });
280
+ el.find('.lb-h-scrollbar').css({ "width" : hLbHeight });
281
+ }
282
+ }
283
+ function hideScrollbars(elem, vscroll, hscroll) {
284
+ var el = $(elem);
285
+
286
+ if (vscroll || hscroll) {
287
+ el.css({ "overflow" : 'hidden' });
288
+ movePadding(el, el.find('.lb-wrap'));
289
+ resizeMainBox(el);
290
+ resizeInnerWrap(el, el.find('.lb-wrap'));
291
+ }
292
+ }
293
+ function resizeMainBox(elem) {
294
+ var el = $(elem);
295
+ el.css({ "width" : el.width() + paddingLeft + paddingRight, "height" : el.height() + paddingTop + paddingBottom });
296
+ }
297
+ function movePadding(from, to) {
298
+ var fromEl = $(from);
299
+ var toEl = $(to);
300
+
301
+ fromEl.css({ "padding" : 0 });
302
+ toEl.css({
303
+ "padding-top" : paddingTop+'px',
304
+ "padding-left" : paddingLeft+'px',
305
+ "padding-bottom" : paddingBottom+'px',
306
+ "padding-right" : paddingRight+'px'
307
+ });
308
+ }
309
+ function resizeInnerWrap(main, child) {
310
+ var mainEl = $(main);
311
+ var childEl = $(child);
312
+ mainEl.css({ "position" : 'relative' });
313
+ childEl.css({
314
+ "width" : mainEl.width()+vScrollWidth - paddingLeft - paddingRight,
315
+ "height" : mainEl.height()+hScrollWidth - paddingTop - paddingBottom
316
+ });
317
+ }
318
+ function setVScrollbarWidth(elem) {
319
+ var el = $(elem);
320
+ el.css({ "overflow" : 'auto' });
321
+ vScrollWidth = offsetWidth - clientWidth - borderLeft - borderRight;
322
+ el.css({ "overflow" : 'hidden' });
323
+ }
324
+ function setHScrollbarWidth(elem) {
325
+ var el = $(elem);
326
+ el.css({ "overflow" : 'auto' });
327
+ hScrollWidth = offsetHeight - clientHeight - borderTop - borderBottom;
328
+ el.css({ "overflow" : 'hidden' });
329
+ }
330
+ function wrap(elem, vscroll, hscroll) {
331
+ var el = $(elem);
332
+ var elemId = el.attr('id');
333
+ var wrap = 0;
334
+
335
+ if (elemId !== undefined) {
336
+ el.wrapInner('<div class="lb-wrap" id="lb-wrap-'+id+'-'+elemId+'"></div>');
337
+ wrap = $('#lb-wrap-'+id+'-'+elemId);
338
+ } else {
339
+ el.wrapInner('<div class="lb-wrap" id="lb-wrap-'+id+'"></div>');
340
+ wrap = $('#lb-wrap-'+id);
341
+ }
342
+ wrap.wrapInner('<div class="lb-content"></div>');
343
+ if (vscroll) {
344
+ el.prepend('<div class="lb-v-scrollbar"></div>');
345
+ el.find('.lb-v-scrollbar').append('<div class="lb-v-scrollbar-slider"></div>');
346
+ }
347
+ if (hscroll) {
348
+ el.prepend('<div class="lb-h-scrollbar"></div>');
349
+ el.find('.lb-h-scrollbar').append('<div class="lb-h-scrollbar-slider"></div>');
350
+ }
351
+
352
+ // preparation for the next element
353
+ id = id + 1;
354
+ }
355
+ function needScrollbars(elem) {
356
+ var el = $(elem);
357
+ addVScroll = false;
358
+ addHScroll = false;
359
+
360
+ getPadding(el);
361
+ getBorders(el);
362
+
363
+ el.css({ "overflow" : 'hidden' });
364
+
365
+ // check for vertical scrollbars
366
+ if (el.get(0).scrollHeight > el.get(0).clientHeight) {
367
+ addVScroll = true;
368
+ // setVScrollbarWidth(el);
369
+ }
370
+
371
+ // check for horizontal scrollbars
372
+ if (el.get(0).scrollWidth > el.get(0).clientWidth) {
373
+ addHScroll = true;
374
+ // setHScrollbarWidth(el);
375
+ }
376
+
377
+ el.css({ "overflow" : 'auto' });
378
+
379
+ if (addVScroll || addHScroll) {
380
+ return true;
381
+ }
382
+ }
383
+ function getPadding(elem) {
384
+ var el = $(elem);
385
+
386
+ paddingTop = parseInt(el.css('padding-top').replace('px', ''));
387
+ paddingLeft = parseInt(el.css('padding-left').replace('px', ''));
388
+ paddingBottom = parseInt(el.css('padding-bottom').replace('px', ''));
389
+ paddingRight = parseInt(el.css('padding-right').replace('px', ''));
390
+ }
391
+ function getBorders(elem) {
392
+ var el = $(elem);
393
+
394
+ borderTop = parseInt(el.css('border-top-width').replace('px', ''));
395
+ borderRight = parseInt(el.css('border-right-width').replace('px', ''));
396
+ borderBottom = parseInt(el.css('border-bottom-width').replace('px', ''));
397
+ borderLeft = parseInt(el.css('border-left-width').replace('px', ''));
398
+ }
399
+ function getDimentions(elem, scroll) {
400
+ var el = $(elem).get(0);
401
+
402
+ scrollHeight = (typeof(scroll) != 'undefined') ? scroll.height : el.scrollHeight;
403
+ scrollWidth = (typeof(scroll) != 'undefined') ? scroll.width : el.scrollWidth;
404
+ clientHeight = el.clientHeight;
405
+ clientWidth = el.clientWidth;
406
+ offsetHeight = el.offsetHeight;
407
+ offsetWidth = el.offsetWidth;
408
+
409
+ setVScrollbarWidth($(elem));
410
+ setHScrollbarWidth($(elem));
411
+ }
412
+
413
+ return this.each(function() {
414
+ //var $this = $(this);
415
+ });
416
+ };
417
+ })( jQuery );
@@ -1,59 +1,15 @@
1
- .scrollbar {
2
- position: absolute;
3
- content: "";
4
- display: block;
5
- border-radius: 100px;
6
- opacity: 0;
7
- z-index: 100;
8
- }
9
-
10
- .vertical {
11
- width: 7px;
12
- right: 2px;
13
- top: 2px;
14
- }
15
-
16
- .horizontal {
17
- height: 7px;
18
- bottom: 2px;
19
- left: 2px;
20
- }
21
-
22
- .scrollbar_bg {
23
- position: absolute;
24
- content: "";
25
- display: block;
26
- border-radius: 100px;
27
- opacity: 0;
28
- z-index: 99;
29
- }
30
-
31
- .scrollbar_bg.horizontal {
32
- width: 100%;
33
- }
34
-
35
- .scrollbar_bg.vertical {
36
- height: 100%;
37
- }
38
-
39
- .scrollbar.light {
40
- background: rgba(255,255,255,0.5);
41
- }
42
-
43
- .scrollbar_bg.light {
44
- background: rgba(255,255,255,0.10);
45
- }
46
-
47
-
48
- .scrollbar.dark {
49
- background: rgba(0,0,0,0.3);
50
- }
51
-
52
- .scrollbar_bg.dark {
53
- background: rgba(0,0,0,0.10);
54
- }
55
-
56
- .nWrap {
57
- overflow: auto;
58
- display: inline-block;
59
- }
1
+ .lb-v-dummy { width: 100%; display: block; height: 1px; }
2
+ .lb-h-dummy { height: 100%; display: block; width: 1px; }
3
+ .lb-clear { clear: both; }
4
+ .lb-wrap { z-index: 0; overflow: auto; position: relative; }
5
+ /*.lb-scrollbar-wrap { position: absolute; left: 0; top: 0; }*/
6
+ .lb-v-scrollbar { z-index: 1; position: absolute; right: 2px; top: 2px; width: 7px; height: 100%; background: #cfcfcf; opacity: 0.3; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; border-radius: 7px; -webkit-border-radius: 7px; -moz-border-radius: 7px; }
7
+ .lb-h-scrollbar { z-index: 1; position: absolute; bottom: 2px; left: 2px; width: 100%; height: 7px; background: #cfcfcf; opacity: 0.3; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; border-radius: 7px; -webkit-border-radius: 7px; -moz-border-radius: 7px; }
8
+ .lb-v-scrollbar-slider { position: absolute; width: 7px; height: 50px; left: 0; top: 0; background: #000; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; border-radius: 7px; -webkit-border-radius: 7px; -moz-border-radius: 7px; }
9
+ .lb-h-scrollbar-slider { position: absolute; height: 7px; width: 50px; left: 0; top: 0; background: #000; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; border-radius: 7px; -webkit-border-radius: 7px; -moz-border-radius: 7px; }
10
+
11
+ <!--[if IE 8]>
12
+ <style>
13
+ .lb-v-scrollbar { background: red; }
14
+ </style>
15
+ <![endif]-->
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-lionbars
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Allen Wei
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-28 00:00:00 Z
18
+ date: 2011-12-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails