Home | Sewingpatterns.shop


Home | Sewingpatterns.shop

JavaScript seems to be disabled in your browser. For the best experience on our site, be sure to turn on Javascript in your browser.

  • 0″> ]]>
  • ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]> ]]>

    ]]>

    ]]> ]]> ]]> ]]> ]]> ]]> Christmas gift idea: Sewingpatterns.shop gift cards! Warm in Winter 0) { $item.css(“padding-bottom”, paddingBottom2 + “px”); } // ————————————————————————- // Compare start height with new (on-hover) height, calculate the difference. // Important: new height includes difference between start padding and new padding var diff = 0; if (h2 0) { diff += paddingBottomDiff; } } // ————————————————————————- // Apply height difference as nagative margin, but only if new height // is larger than start height. if (diff > 0) { $item.css(“margin-bottom”, “-” + diff + “px”); } } }).on(‘mouseleave’, ‘.item’, function() { var $item = $(this); if ($(window).width() >= 320) { // Clean up $item.find(“.display-onhover”).stop(true).hide(); $item.css(“margin-bottom”, “”); $item.height(startHeight); $item.css(“padding-bottom”, startPaddingBottom); } }); $(‘.items-grid, .products-list’).on(‘mouseenter’, ‘.product-item-img’, function() { $(this).find(“.alt-img”).fadeIn(400, “easeOutCubic”); }).on(‘mouseleave’, ‘.product-item-img’, function() { $(this).find(“.alt-img”).stop(true).fadeOut(400, “easeOutCubic”); }); $(‘.fade-on-hover’).on(‘mouseenter’, function() { $(this).animate({opacity: 0.75}, 300, ‘easeInOutCubic’); }).on(‘mouseleave’, function() { $(this).stop(true).animate({opacity: 1}, 300, ‘easeInOutCubic’); }); // Drop-down var ddBlockSelector = ‘.dropdown-block-trigger’; // ‘.dropdown-block’; var ddOpenTimeout; var dMenuPosTimeout; var DD_DELAY_IN = 200; var DD_DELAY_OUT = 0; var DD_ANIMATION_IN = 0; var DD_ANIMATION_OUT = 0; $(document).on(‘mouseenter touchstart’, ddBlockSelector, function(e) { var dd = $(this); var ddHeading = dd.children(‘.dropdown-heading’); var ddContent = dd.children(‘.dropdown-content’); // If dd is not opened yet (or not initialized yet) var isDdOpened = dd.data(‘ddOpened’); if (isDdOpened === false || isDdOpened === undefined) { // Clear old position of dd menu ddContent.css(“left”, “”); ddContent.css(“right”, “”); // Show dd menu clearTimeout(ddOpenTimeout); ddOpenTimeout = setTimeout(function() { dd.addClass(‘open’); // Set dd open flag dd.data(‘ddOpened’, true); }, DD_DELAY_IN); ddContent.stop(true, true).delay(DD_DELAY_IN).fadeIn(DD_ANIMATION_IN, “easeOutCubic”); // Set new position of dd menu. // This code is delayed the same amount of time as dd animation. clearTimeout(dMenuPosTimeout); dMenuPosTimeout = setTimeout(function() { if (ddContent.offset().left 100) { $(‘#scroll-to-top’).fadeIn(); } else { $(‘#scroll-to-top’).fadeOut(); } }, 500); }); $(‘#scroll-to-top’).click(function(){ $(“html, body”).animate({scrollTop: 0}, 600, “easeOutCubic”); return false; }); var dResize = { winWidth : 0 , winHeight : 0 , windowResizeTimeout : null , init : function() { dResize.winWidth = $(window).width(); dResize.winHeight = $(window).height(); dResize.windowResizeTimeout; $(window).on(‘resize’, function(e) { clearTimeout(dResize.windowResizeTimeout); dResize.windowResizeTimeout = setTimeout(function() { dResize.onEventResize(e); }, 50); }); } , onEventResize : function(e) { //Prevent from executing the code in IE when the window wasn’t actually resized var winNewWidth = $(window).width(); var winNewHeight = $(window).height(); //Code in this condition will be executed only if window was actually resized if (dResize.winWidth != winNewWidth || dResize.winHeight != winNewHeight) { //Trigger deferred resize event $(window).trigger(“themeResize”, e); //Additional code executed on deferred resize dResize.onEventDeferredResize(); } //Update window size variables dResize.winWidth = winNewWidth; dResize.winHeight = winNewHeight; } , onEventDeferredResize : function() //Additional code, execute after window was actually resized { //Products grid: equal height of items setGridItemsEqualHeight(); } }; //end: dResize dResize.init(); }); //end: on document ready jQuery(window).on(‘load’,function() { setGridItemsEqualHeight(); }); //end: on load }); //end: requirejs requirejs([‘jquery’, ‘enquire’], function(jQuery, enquire) { jQuery(function($) { // Collapsible block // This plugin requires a specific markup structure. The plugin expects a set of elements that it // will use as the toggle link. It then hides all immediately following siblings and toggles the sibling’s // visibility when the toggle link is clicked. // // Example markup: // // Trigger]]> //

    Content that should show when

    // // // JS: jQuery(‘.block-title’).toggleSingle(); // // Options: // destruct: defaults to false, but if true, the plugin will remove itself, display content, and remove event handlers jQuery.fn.toggleSingle = function (options) { var settings = $.extend({ destruct: false }, options); return this.each(function () { if (!settings.destruct) { $(this).on(‘click’, function () { $(this) .next() .toggleClass(‘no-display’) .parent() .toggleClass(‘active’); }); // Hide the content $this = $(this); if (!$this.parent().hasClass(‘active’)) { $this.next().addClass(‘no-display’); } } else { // Remove event handler so that the toggle link can no longer be used $(this).off(‘click’); // Remove all classes that were added by this plugin $(this) .next() .removeClass(‘no-display’) .parent() .removeClass(‘active’); } }); } // end: toggleSingle // Collapsible block – with delegated event // Modification of the standard collapsible block plugin. It has a delegated click event attached to block’s container. // It is required for some blocks inside “additional sidebar” (currently: wishlist and compare) // which are created/modified dynamically by Magento’s JavaScript code. jQuery.fn.toggleMultiBlocks = function (options) { var settings = $.extend({ destruct: false, blockHeadingSelector: ‘.block-title’ }, options); return this.each(function () { // Container of blocks var $sidebar = $(this); // All blocks inside the container var $blockHeadings = $sidebar.find(settings.blockHeadingSelector); if (!settings.destruct) { $sidebar.on(‘click’, settings.blockHeadingSelector, function(e) { $(this) .next().toggleClass(‘no-display’) .parent().toggleClass(‘active’); }); // Hide the content in all blocks $blockHeadings.each(function () { var heading = $(this); if (!heading.parent().hasClass(‘active’)) { heading.next().addClass(‘no-display’); // Here we may need to add that class to the next sibling // if block’s content consists of more elements than just one: // .next().addClass(‘no-display’) } else { heading.next().removeClass(‘no-display’); } }); } else { // Remove event handler so that the toggle link can no longer be used $sidebar.off(‘click’); // Remove all classes that were added by this plugin $blockHeadings .next().removeClass(‘no-display’) .parent().removeClass(‘active’); } }); } // end: toggleMultiBlocks var breakpointScreenM = 768; // The same value as Magento’s breakpoint @screen__m // Blocks collapsing on smaller viewports enquire.register(‘(max-width: ‘ + (breakpointScreenM – 1) + ‘px)’, { setup: function () { this.toggleElements = $( ‘.mobile-collapsible .block-title’ ); this.delayedToggleElements = $( ‘.sidebar’ ); }, match: function () { this.toggleElements.toggleSingle(); this.delayedToggleElements.toggleMultiBlocks({blockHeadingSelector: ‘.block:not(#layered-filter-block) .block-title’}); }, unmatch: function () { this.toggleElements.toggleSingle({destruct: true}); this.delayedToggleElements.toggleMultiBlocks({destruct: true, blockHeadingSelector: ‘.block:not(#layered-filter-block) .block-title’}); } }); // Blocks collapsing on all viewports. // For backward compatibility exclude blocks which have both classes: “collapsible” and “mobile-collapsible” $(‘.collapsible:not(.mobile-collapsible) .block-title’).toggleSingle(); }); //end: on document ready }); //end: requirejs //]]>

    Source

    Leave a Reply