Skip to content

Instantly share code, notes, and snippets.

@jaseflow
Created December 7, 2012 02:11
Show Gist options
  • Save jaseflow/4230183 to your computer and use it in GitHub Desktop.
Save jaseflow/4230183 to your computer and use it in GitHub Desktop.
/*!
* Wotif Sticky
* @requires jQuery v1.7.2+
*
* Description
*
* @author ...
*/
// $('.results-hd').waypoint(function(e,direction) {
// console.log(direction);
// if (direction == 'down') {
// $('.map').css({position:'fixed', top:0});
// }
// else if (direction == 'up') {
// $('.map').css({position:'absolute', top: (gridHeaderHeight+matrixDividerHeight) + 'px', left: 300});
// }
// });
!(function($) {
window.Wotif.Sticky = window.Wotif.Sticky || window.Wotif.BaseModule(function() {
var $el,
dealRowHeight,
tableWidth,
totalDealRows,
gridHeaderHeight,
matrixDividerHeight,
dealsOffset,
matrixOffset;
return {
init: function() {
$el = $('body');
$dealRowHeight = $('tr.deals').height(),
$tableWidth = $('.matrix').width(),
$totalDealRows = $('.deals').length,
$gridHeaderHeight = $('.grid-header').height(),
$matrixDividerHeight = $('.matrix-divider').height(),
$dealsOffset = $('.wothotel').offset(),
$matrixOffset = $('.matrix').offset();
$resultsHead = $('.results-hd');
this.attachEvents();
},
attachEvents: function() {
$resultsHead.waypoint(e,direction) {
// Run stickyHeader
}
},
events: {
stickyHeader: function(e) {
e.preventDefault();
alert(direction);
}
}
}
}());
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment