first commits
This commit is contained in:
75
public/js/hux-blog.js
Normal file
75
public/js/hux-blog.js
Normal file
@@ -0,0 +1,75 @@
|
||||
/*!
|
||||
* Clean Blog v1.0.0 (http://startbootstrap.com)
|
||||
* Copyright 2015 Start Bootstrap
|
||||
* Licensed under Apache 2.0 (https://github.com/IronSummitMedia/startbootstrap/blob/gh-pages/LICENSE)
|
||||
*/
|
||||
|
||||
// Tooltip Init
|
||||
$(function() {
|
||||
$("[data-toggle='tooltip']").tooltip();
|
||||
});
|
||||
|
||||
|
||||
// make all images responsive
|
||||
/*
|
||||
* Unuse by Hux
|
||||
* actually only Portfolio-Pages can't use it and only post-img need it.
|
||||
* so I modify the _layout/post and CSS to make post-img responsive!
|
||||
*/
|
||||
// $(function() {
|
||||
// $("img").addClass("img-responsive");
|
||||
// });
|
||||
|
||||
// responsive tables
|
||||
$(document).ready(function() {
|
||||
$("table").wrap("<div class='table-responsive'></div>");
|
||||
$("table").addClass("table");
|
||||
});
|
||||
|
||||
// responsive embed videos
|
||||
$(document).ready(function () {
|
||||
$('iframe[src*="youtube.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>');
|
||||
$('iframe[src*="youtube.com"]').addClass('embed-responsive-item');
|
||||
$('iframe[src*="vimeo.com"]').wrap('<div class="embed-responsive embed-responsive-16by9"></div>');
|
||||
$('iframe[src*="vimeo.com"]').addClass('embed-responsive-item');
|
||||
});
|
||||
|
||||
// Navigation Scripts to Show Header on Scroll-Up
|
||||
jQuery(document).ready(function($) {
|
||||
var MQL = 1170;
|
||||
|
||||
//primary navigation slide-in effect
|
||||
if ($(window).width() > MQL) {
|
||||
var headerHeight = $('.navbar-custom').height(),
|
||||
bannerHeight = $('.intro-header .container').height();
|
||||
$(window).on('scroll', {
|
||||
previousTop: 0
|
||||
},
|
||||
function() {
|
||||
var currentTop = $(window).scrollTop(),
|
||||
$catalog = $('.side-catalog');
|
||||
//check if user is scrolling up
|
||||
if (currentTop < this.previousTop) {
|
||||
//if scrolling up...
|
||||
if (currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) {
|
||||
$('.navbar-custom').addClass('is-visible');
|
||||
} else {
|
||||
$('.navbar-custom').removeClass('is-visible is-fixed');
|
||||
}
|
||||
} else {
|
||||
//if scrolling down...
|
||||
$('.navbar-custom').removeClass('is-visible');
|
||||
if (currentTop > headerHeight && !$('.navbar-custom').hasClass('is-fixed')) $('.navbar-custom').addClass('is-fixed');
|
||||
}
|
||||
this.previousTop = currentTop;
|
||||
|
||||
//adjust the appearance of side-catalog
|
||||
$catalog.show()
|
||||
if (currentTop > (bannerHeight + 41)) {
|
||||
$catalog.addClass('fixed')
|
||||
} else {
|
||||
$catalog.removeClass('fixed')
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user