brouilleursdeblanc/assets/js/_main.js

63 lines
2 KiB
JavaScript
Raw Normal View History

2013-06-25 20:19:49 +00:00
/*! Plugin options and other jQuery stuff */
// Responsive Nav
var navigation = responsiveNav("#site-nav", { // Selector: The ID of the wrapper
animate: true, // Boolean: Use CSS3 transitions, true or false
transition: 400, // Integer: Speed of the transition, in milliseconds
label: "<i class='icon-reorder'></i> Menu", // String: Label for the navigation toggle
insert: "before", // String: Insert the toggle before or after the navigation
customToggle: "", // Selector: Specify the ID of a custom toggle
openPos: "relative", // String: Position of the opened nav, relative or static
jsClass: "js", // String: 'JS enabled' class which is added to <html> el
init: function(){}, // Function: Init callback
open: function(){}, // Function: Open callback
close: function(){} // Function: Close callback
});
$('html').click(function() {
//Hide the menus if visible
navigation.toggle();
});
$('#site-nav').click(function(event){
event.stopPropagation();
});
2013-06-25 20:19:49 +00:00
// FitVids options
$(function() {
$("article").fitVids();
2013-09-11 16:12:08 +00:00
});
// Simple Jekyll Search options
$(document).ready(function() {
$('.search-field').simpleJekyllSearch({
2013-09-11 20:08:29 +00:00
jsonFile : 'search.json',
2013-09-11 16:12:08 +00:00
searchResults : '.search-results',
template : '<li><article><a href="{url}">{title} <span class="entry-date"><time datetime="{date}">{shortdate}</time></span></a></article></li>',
noResults: '<p>Nothing found.</p>'
});
});
(function( $, window, undefined ) {
var bs = {
close: $(".icon-remove-sign"),
2013-09-11 18:24:55 +00:00
searchform: $(".search-form"),
2013-09-11 16:12:08 +00:00
canvas: $("body"),
dothis: $('.dosearch')
};
bs.dothis.on('click', function() {
$('.search-wrapper').css({ display: "block" });
bs.searchform.toggleClass('active');
bs.searchform.find('input').focus();
bs.canvas.toggleClass('search-overlay');
});
bs.close.on('click', function() {
2013-09-11 18:24:55 +00:00
$('.search-wrapper').removeAttr( 'style' );
2013-09-11 16:12:08 +00:00
bs.searchform.toggleClass('active');
bs.canvas.removeClass('search-overlay');
});
})( jQuery, window );