$(window).scroll(function () { if($(this).scrollTop() > 250) { if (!$('.docked-nav').hasClass('fixed')) { $('.docked-nav').stop().addClass('fixed').css('top', '-70px').animate( { 'top': '0px' }, 300); } } else { $('.docked-nav').removeClass('fixed'); } }); $(document).ready(function(){ var navBtn = $('.mob-nav-btn'); var mobNav = $('.mobile-nav'); var closeNav = $('.mobile-nav .close'); $(navBtn).click(function(e){ e.preventDefault(); $(mobNav).toggleClass('show'); if ( $(mobNav).hasClass('show') ) { $(navBtn).addClass('hide'); } }) $(closeNav).click(function(e){ e.preventDefault(); $(mobNav).removeClass('show'); $(navBtn).removeClass('hide'); }) $.fn.stars = function() { return $(this).each(function() { // Get the value var val = parseFloat($(this).html()); // Make sure that the value is in 0 - 5 range, multiply to get width var size = Math.max(0, (Math.min(5, val))) * 20; // Create stars holder var $span = $('').width(size); // Replace the numerical value with stars $(this).html($span); }); } $('.expandy .read-more').click(function(e){ e.preventDefault(); $('.expandy').toggleClass('expanded'); }); $('.find-it').click(function(e){ e.preventDefault(); $('#stockists').toggleClass('open'); $('#stockists .close').click(function(e){ e.preventDefault(); $('#stockists').removeClass('open'); }); }); $(document).ready(function(){ $('.now-pouring-slider').bxSlider({ 'pager': true, 'controls': false, 'auto': true, 'randomStart': true }); }); }); $(document).ready(function() { var igFeed = "https://api.instagram.com/v1/users/self/media/recent/?access_token=2135939111.571a066.8c0e1cc2837b465f8194ecd746793f5a&count=2&callback=?"; $.getJSON(igFeed, function (json) { console.log(json); $.each(json.data, function(i, item){ var html = "