Skip to content

Commit

Permalink
More improvements to the layout of the sidebar hover feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jun 13, 2010
1 parent ab3a239 commit 1fa8666
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/stylesheets/screen.sass
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ body.salad
+column(!sidebar_columns, true)
+no-bullets
:height auto
hr
>hr
:border-top thin solid #EDF2BF
:background #EDF2BF
:margin-bottom 0
li
:padding 5px 0px
#item-list-top
Expand All @@ -136,11 +137,11 @@ body.salad
:position relative
:top 50px
#item-list-bottom
:background url('/images/sidebar_hover_bottom_fade.png') top no-repeat
:background url('/images/sidebar_hover_bottom_fade.png') bottom no-repeat
:display block
:height 30px
:position relative
:top -27px
:top -24px
#panel
:display inline-block
:padding 13px 12px 11px
Expand Down
10 changes: 7 additions & 3 deletions public/javascripts/autoScroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $.fn.autoScroller = function(options) {
var opts = $.extend({}, $.fn.autoScroller.defaults, options);
var width = $(this).parent().width(),
$innerUnorderedList = $(this).find('ul'),
previousOffset = 0;
previousOffset = null;

$innerUnorderedList.css('max-height', opts.height)
.css('overflow-y', 'hidden');
Expand All @@ -24,9 +24,12 @@ $.fn.autoScroller = function(options) {
}

if ($(this).is(':visible')) {
var stop = false;
var stop = false,
$unorderedList = $('ul.hover li:visible > hr:first');

$innerUnorderedList.scrollTop(0);

// $unorderedList.before($("<div id='list-item-top'>"));
setInterval(function() {

if (false == stop) {
Expand All @@ -37,13 +40,14 @@ $.fn.autoScroller = function(options) {
.animate({scrollTop: 0}, opts.speed / 2);
}

previousOffset = $innerUnorderedList.scrollTop();

$('body').mouseout(function() { stop = true; }).mouseover(function() { stop = false; });

if ((previousOffset && $innerUnorderedList.scrollTop()) == 0) {
stop = false;
}

previousOffset = $innerUnorderedList.scrollTop();
}
}, opts.speed);
}
Expand Down

0 comments on commit 1fa8666

Please sign in to comment.