biofriction-wp-theme/node_modules/foundation-sites/docs/assets/js/docs.examples.js

31 lines
841 B
JavaScript
Raw Normal View History

2021-10-26 14:18:09 +02:00
// Code for specific docs examples.
!function() {
$('[data-docs-example-ofc]').click(function() {
$('#offCanvasLeft').toggleClass('reveal-for-large');
$('.sticky').foundation('_calc', true);
});
$('[data-docs-example-series]').click(function() {
$('#series-example').addClass('is-animating');
});
var $transitionDemo = $('.docs-transition-demo');
$('.docs-transitions').change(function() {
var value = $(this).val();
var method = value.match('-in') ? 'animateIn' : 'animateOut';
Foundation.Motion[method]($transitionDemo, value, function() {
$transitionDemo.show();
});
});
var stickyMag = $('#sticky-magellan');
stickyMag.on('sticky.zf.stuckto:top', function(){
stickyMag.find('nav').addClass('stuck-mag');
}).on('sticky.zf.unstuckfrom:top', function(e){
stickyMag.find('nav').removeClass('stuck-mag');
});
}();