forked from vincentchan/mickey
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooter-scripts.html
More file actions
51 lines (42 loc) · 1.82 KB
/
footer-scripts.html
File metadata and controls
51 lines (42 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!-- Javascript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="{{ site.baseurl_javascripts }}imagesloaded.pkgd.min.js"></script>
{% if page.syntaxHighlighter %}
<script src="{{ site.baseurl_javascripts }}prism.js"></script>
<script src="{{ site.baseurl_javascripts }}plugins/prism-line-numbers.min.js"></script>
{% endif %}
<script>
$(document).ready(function(){
// Featured image loaded behavior
$('.section-backgroundImage img').imagesLoaded()
.done( function( instance ) {
$('.post-featuredImage').addClass('is-loaded');
});
// Modal toggle behavior
$('.modal-toggle-wrapper').click(function() {
$(this).toggleClass('active');
$('.modal-toggle-bubble').toggleClass('active');
$('.modal-toggle-bubbleShadow').toggleClass('active');
$('.modal-toggle-close-wrapper').toggleClass('active');
$('.fullscreenModal').toggleClass('active');
});
// Prevent default anchor event and make a share popup
$.fn.sharePopup = function (e, intWidth, intHeight, blnResize) {
e.preventDefault();
intWidth = intWidth || '750';
intHeight = intHeight || '500';
strResize = (blnResize ? 'yes' : 'no');
//// Set title and open popup with focus on it
var strTitle = ((typeof this.attr('title') !== 'undefined') ? this.attr('title') : 'Social Share'),
strParam = 'width=' + intWidth + ',height=' + intHeight + ',resizable=' + strResize,
objWindow = window.open(this.attr('href'), strTitle, strParam).focus();
}
$('.shareButton').on("click", function(e) {
$(this).sharePopup(e);
});
});
// Show modal toggle after scrolling 300px
$(document).scroll(function() {
$('.modal-toggle-group').toggleClass('active', $(document).scrollTop() >= 300);
});
</script>