Skip to content

Instantly share code, notes, and snippets.

@jaseflow
jaseflow / CSS
Created September 10, 2012 02:44
.container {
width: 960px;
margin: 0 auto;
}
.col {
float: left;
padding-left: 20px
box-sizing: border-box;
}
var _options = {
fx: 'scrollLeft',
next: '.right',
prev: '.left',
pager: '.rotator-index',
activePagerClass: 'active'
};
/*globals jQuery, $, wotif, alert */
// Home search
wotif.homeSearch = (function (utils) {
var selectors = {
searchForm: "#search-form",
searchButton: "#search-btn",
@jaseflow
jaseflow / Sticky shit.js
Created December 3, 2012 23:26
Sticky shit
var dealRowHeight = $('tr.deals').height(),
tableWidth = $('.matrix').width(),
totalDealRows = $('.deals').length;
gridHeaderHeight = $('.grid-header').height();
matrixDividerHeight = $('.matrix-divider').height();
dealsOffset = $('.wothotel').offset();
matrixOffset = $('.matrix').offset();
$('body').on('click', '.toggle-map', function() {
/*!
* Wotif MapView
* @requires jQuery v1.7.2+
*
* Description
*
* @author ...
*/
!(function($) {
/*!
* Wotif Sticky
* @requires jQuery v1.7.2+
*
* Description
*
* @author ...
*/
// $('.results-hd').waypoint(function(e,direction) {
/*!
* Wotif MapView
* @requires jQuery v1.7.2+
*
* Description
*
* @author ...
*/
!(function($) {
// Switch active card on swipe
$(".cards").hammer().bind("swipe", function(ev) {
if (ev.direction == "left") {
if (activeCard.is(':first-child')) {
// Do nothing
}
else {
$('.card.active').removeClass('active').next('.card').addClass('active');
}
}
$('.datepicker-toggle').datepicker({
numberOfMonths: 6,
dateFormat: 'D dd M',
minDate: 0,
showAnim: '',
onSelect: function(dateText, inst) {
var selectedDate = this.value;
// need to make this detect todays date
if (this.value == 'Fri 18 Jan') {
this.events.showError();
showSourceCode: function(e) {
var html = $('.source').html();
$("<pre />", {
"html":
$("html")
.html()
.replace(/[<>]/g, function(m) { return {'<':'&lt;','>':'&gt;'}[m]})
.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>') +
'\n&lt;/html>'
}).appendTo("#source-code");