-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unstyled slider to naively filter by popularity
- Loading branch information
Showing
9 changed files
with
495 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,51 @@ | |||
(function($) { | |||
$.widget("ui.hiderslider", { | |||
options: { | |||
title: 'HiderSlider' | |||
}, | |||
|
|||
_create: function() { | |||
var self = this, | |||
o = self.options, | |||
el = self.element, | |||
$inner; | |||
|
|||
// Append markup | |||
$(el).append('<div class="ui-sliderhider-container">' + | |||
'<div class="ui-sliderhider-title">'+o.title+'</div>' + | |||
'<div class="ui-sliderhider-content">' + | |||
'<div class="ui-sliderhider-inner">' + | |||
'<div class="ui-sliderhider-slider"></div>' + | |||
'<div class="ui-sliderhider-close">X</div>' + | |||
'</div>' + | |||
'</div>' + | |||
'</div>'); | |||
|
|||
// Init slider | |||
$('.ui-sliderhider-slider', el).slider(o.slider); | |||
|
|||
// Manually set the width on inner to keep floated elements from jumping | |||
$inner = $('.ui-sliderhider-inner'); | |||
$inner.width($inner.outerWidth()); | |||
|
|||
// Toggle visibility when you click the title | |||
$('.ui-sliderhider-title').click(function(){ | |||
self.toggleVisiblity(); | |||
}); | |||
|
|||
// Toggle visibility when you click the close link | |||
$('.ui-sliderhider-close').click(function(){ | |||
self.toggleVisiblity(); | |||
}); | |||
}, | |||
|
|||
// Toggle visiblity | |||
toggleVisiblity: function() { | |||
$('.ui-sliderhider-content', self.element).animate({width: 'toggle'}); | |||
}, | |||
|
|||
destroy: function() { | |||
this.element.empty(); | |||
} | |||
}); | |||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,29 @@ | |||
.ui-sliderhider-container { | |||
overflow: auto; | |||
} | |||
|
|||
.ui-sliderhider-container > div { | |||
float:left; | |||
} | |||
|
|||
.ui-sliderhider-title { | |||
padding: 10px; | |||
} | |||
|
|||
.ui-sliderhider-content { | |||
padding: 10px 0; | |||
overflow: hidden; | |||
} | |||
|
|||
.ui-sliderhider-inner {} | |||
|
|||
.ui-sliderhider-inner > div { | |||
float: left; | |||
margin: 0 10px; | |||
} | |||
|
|||
.ui-sliderhider-slider { | |||
width:300px; | |||
} | |||
|
|||
.ui-sliderhider-close {} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.