/* Page Loader */ $(window).load(function() { $(".loader").fadeOut("slow"); }); /* Wrap Navigation in Container */ $('#categories-list').wrap('
'); /* Temporary Sale Banner $('

Check out our Whopping Black Friday Discounts only available this weekend and on a \'first come first served\' basis.

').insertBefore( 'body' ); */ /* Add Parent Class to Dropdown Links */ $("#categories-list > li").has("ul").addClass('parent'); $("#categories-list > li > ul").addClass('dropdown'); /* Display Menu Sub Nav */ $(".parent").click(function(){ $(this).children(".parent > .dropdown").slideToggle("fast"); $(this).toggleClass("active"); }); $(document).ready(function(){ if($(window).width() >= 1200){ //only works on screensizes larger than 1200px $(".parent").click(function(){ $(".parent").not(this).children("#categories-list > .parent > .dropdown").slideUp("fast"); $(".parent").not(this).removeClass("active"); }); } }); /* Add Mobile Menu Button to Lower Bar */ $('#menu-button').prependTo('#lower_bar'); /* Display Mobile Menu */ $("#menu-button").click(function(){ $("#categories-list").slideToggle(); $(this).toggleClass("open"); }); /* Enable Toggle for Footer Navigation */ $(document).ready(function(){ if($(window).width() <= 992){ //only works on screensizes smaller than 992px $(".FooterTitle").click(function(){ $(this).siblings(".footer-nav-list").slideToggle(); $(this).toggleClass("active"); }); } }); /* Wrap Top Bar Elements in Container */ $('#top_bar_1, #top_bar_2').wrapAll('
'); /* Display Find Us in Top Bar */ $('
  • Find Us
  • ').insertAfter('#inline_account_links > ul > li:last-child'); /* Display Delivery Link in Top Bar */ $('').insertAfter('#inline_basket_links > ul > li:last-child'); /* Change Account Text */ $(document).ready(function() { $("#inline_account_links > ul > li > a").text(function () { return $(this).text().replace("Your Account", "Account"); }); }); /* Add Placeholder to Search Form */ $('#search_form > fieldset > input#l_nav_search.text').each( function(i,el) { if (!el.value || el.value == '') { el.placeholder = 'Search Entire Store...'; } }); /* Search Page Requirements */ $(function() { var loc = window.location.href; // returns the full URL if(/search/.test(loc)) { $('#content > p').addClass('bmar'); } }); /* Add Placeholder to Newsletter Form */ $('.email').each( function(i,el) { if (!el.value || el.value == '') { el.placeholder = 'Enter your email...'; } }); /* Insert Breadcrumb Before H1 */ $('#content > p.breadcrumb').each(function() { $(this).insertBefore('#content > h1:first-of-type'); }); /* Insert Breadcrumb Before H1 on Product Page */ $('.product-view-wrapper > p.breadcrumb').each(function() { $(this).insertBefore('.product-view-wrapper > h1:first-of-type'); }); /* Edit Breadcrumb Divider */ $(".breadcrumb").html(function(i, text) { return text.replace(/»/g, ''); }); /* Wrap Page H1 & Breadcrumb in Container */ $('#content > h1:first-of-type, #content > p.breadcrumb').wrapAll('
    '); /* Wrap Product Product Page H1 & Breadcrumb in Container */ $('.product-view-wrapper > h1:first-of-type, .product-view-wrapper > p.breadcrumb').wrapAll('
    '); /* Add Smaller Title Width for News Section */ $(function() { var loc = window.location.href; // returns the full URL if(/news/.test(loc)) { $('#page-title-section').addClass('small-title-section'); } }); /* Scroll to Page Anchor */ $(function(){ $('a[href*="#"]:not([href="#"])').click(function() { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 1000); return false; } }); }); /* Scroll to Top Function */ $(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrollTop() > 500) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); $('.scrollup').click(function(){ $("html, body").animate({ scrollTop: 0 }, 600); return false; }); }); /* Add Container Class to Contact Form & Product Page Containers */ $( "#form27, #product_top, .product-listings, #related_products_list, #form_basket, #order_history, #product_description" ).addClass( "container" ); /* Wrap Form Error & Sitemap in Container */ $( "#form_error, .sitemap" ).wrap( "
    " ); /* Add Title to Sitemap */ $('

    Site Map

    ').insertBefore('.sitemap'); /* Add Col Class to Category Listings */ $( ".category-listings" ).addClass( "container" ); /* Relocate Category Listings to After H2 */ $('.category-listings').appendTo('#page-title-section'); /* Add Column Class to Product Listings */ $( ".product-listings > li" ).addClass( "col-xs-6 col-sm-4 col-lg-2" ); /* Reorder Fetaured Products on Homepage */ $(function(){ if (window.location.pathname == "/" || window.location.pathname == "/index" || window.location.pathname == "/index.html") { $('.product-listings').insertAfter('#wizzy31'); } }); /* Wrap Product Image in Container */ $('.product_image').wrap('
    '); /* Relocate Was Price to Start of Div & Change Text for Product Listing */ $(".price_was").each(function() { $(this).closest(".productbox").prepend(this); $(this).text('Sale'); }); /* Add Product Listing Title & Price in Same Div */ $(".productbox > h2, .productbox > h3").each(function(index) { $(this).next(".product_price").andSelf().wrapAll("
    ") }); /* Hide Pagination When Empty */ $(document).ready(function(){ $(".pagination:empty").addClass("hidden"); }); /* Product Page Requirements */ $( "#product_top" ).addClass( "container" ); /* Add Product Rating to Product Information Section */ $( ".rating" ).prependTo( "#product_info" ); /* Add Product Details Title */ $('

    Product Details

    ').prependTo('#product_info'); /* Add VAT Message Below Price */ $( '

    Price Includes VAT at 23%

    ' ).insertAfter( '#product_price'); /* Add Col Class To Product Info & Images then Wrap in Row */ $('#product_images, #product_info').addClass("col-md-6").wrapAll('
    '); /* Wrap Product Images in Col */ $('#prod_sub_images > a').wrap('
    '); /* Ensure All Product Image Wraps Are The Same Size */ $(document).ready(function(){ var cw = $('.sub-product-image-wrap').width(); $('.sub-product-image-wrap').css({ 'height': cw + 'px' }); }); /* Move Product Video Button To last Product Thumbnail Image */ $('.product-video-container').appendTo('#prod_sub_images > .sub-image-container:last-of-type > .sub-product-image-wrap'); /* Add Sale Ribbon To Pages with Discount */ $( '
    Reduced Price
    ' ).insertBefore( '#product_price_was' ).prependTo('#product_images'); /* Move Sharing to After Product Ref */ $( ".sharing" ).insertAfter( "#product_ref" ); /* Click to Display Ratings */ $(document).ready(function(){ $(".rating-info-icon").click(function(){ $(".rating-info").slideToggle(); }); $('').appendTo('.rating-info'); }); /* Change Rating Text */ $(document).ready(function() { $(".rating .you-rated").text(function () { return $(this).text().replace("Login to rate this product", "Login to Rate"); }); $(".rating .you-rated").text(function () { return $(this).text().replace("You rated this at 5 out of 5 stars", "You Rated 5 Stars"); }); $(".rating .you-rated").text(function () { return $(this).text().replace("You rated this at 4 out of 5 stars", "You Rated 4 Stars"); }); $(".rating .you-rated").text(function () { return $(this).text().replace("You rated this at 3 out of 5 stars", "You Rated 3 Stars"); }); $(".rating .you-rated").text(function () { return $(this).text().replace("You rated this at 2 out of 5 stars", "You Rated 2 Stars"); }); $(".rating .you-rated").text(function () { return $(this).text().replace("You rated this at 1 out of 5 stars", "You Rated 1 Stars"); }); $(".rating .you-rated").text(function () { return $(this).text().replace("You rated this at 0 out of 5 stars", "You Rated 0 Stars"); }); }); /* Change Nil Price to POA on Product Page */ $(document).ready(function() { $("#product_price").text(function () { return $(this).text().replace("€0.00", "€POA"); }); }); /* Change Nil Price to POA on Product Listing */ $(document).ready(function() { $(".product_price").text(function () { return $(this).text().replace("€0.00", "€POA"); }); }); /* Add Out of Stock Message to Products */ $(document).ready(function() { $("#product_out_of_stock").text(function () { return $(this).text().replace("Sorry, this product is out of stock.", "Sorry, this product is out of stock. For additional information please do not hesitate to contact our friendly team."); }); }); /* Add Contact Button to Out of Stock Product */ $('

     Get in Touch

    ').insertAfter('#product_out_of_stock'); /* Show Free Delivery Underneath Product VAT Message */ $('

    100% Guarantee on All Products
    Click & Collect Available

    ').insertBefore('#form_product_add'); /* Add Title to Product Description if Not Empty */ $(document).ready(function() { $('#product_description > div.hr').remove(); }); $( '

    Information

    ' ).insertBefore('#product_description'); /* Remove Related Products List from Product Description */ $( '#related_products_list' ).insertAfter('#product_description'); /* Add Title to Related Products */ $( '

    Related Products

    ' ).insertBefore('#related_products_list'); /* Add Related Products Link in Product Info Section */ $( '
    If you like this product, you\'ll love these!' ).insertBefore('#related_products_list').appendTo('#product-page-guarantee'); /* Wrap Related Products List Items In Div */ $( "#related_products_list > li" ).wrap('') $('.related-product-col').wrapAll(''); /* Relocate Related Title to After Image */ $('.related-product-col .title').each(function() { $(this).appendTo(this.parentNode); }); /* Wrap Related Product Image in Container */ $('.related-product-col img').wrap('
    '); /* File Upload Requirements */ $('#l_per_2').html('Picture 1*'); $(function () { $('#per_2').on("change", function() { $('#l_per_2 span').text($(this).val().split('\\').pop()); }); }); $('#l_per_4').html('Picture 2'); $(function () { $('#per_4').on("change", function() { $('#l_per_4 span').text($(this).val().split('\\').pop()); }); }); /* Add Intro Text to Basket Page */ $(function(){ if (window.location.pathname == "/basket/" || window.location.pathname == "/basket" || window.location.pathname == "/basket.html" || window.location.pathname == "/ basket/" || window.location.pathname == "/ basket" || window.location.pathname == "/ basket.html") { $('

    Rose Taylor Curtains offer a 100% guarantee on all orders, the vast majority of which are delivered within 5 working days. We also offer FREE returns through PayPal and amazing customer support which makes it easy to see why we are so highly rated.

    ').insertAfter('#page-title-section > h1'); } }); /* Add Table Row for Featured Items */ $(function(){ if (window.location.pathname == "/basket/" || window.location.pathname == "/basket" || window.location.pathname == "/basket.html") { $('#featured-offers').appendTo('#shopping-basket-items > tfoot').wrapAll(''); $('#skip-offers').insertBefore('#featured-offers'); $('
      Great Value
    ').prependTo('.productimg'); } }); /* Create Testimonials Link */ $('customer feedback.').insertAfter('#payment_options'); /* Add Testimonials to Basket Page */ $(function(){ if (window.location.pathname == "/confirm-order/" || window.location.pathname == "/confirm-order" || window.location.pathname == "/confirm-order.html") { /* Edit Basket Summary */ $('#checkout_customer > p:last-of-type').addClass('updated-basket-text').html('Please select from the options below to complete your purchase. If you wish to change your order details then why not continue shopping for more products or you can edit your basket. Alternatively, see why we are rated so highly and check out some of our previous '); /* Insert Testimonials Link */ $('#basket-testimonials-link').appendTo('.updated-basket-text'); /* Add Testimonials Section */ $('

    Testimonials

    Rose Taylor Curtains pride ourselves on customer service and building customer relationships. See some of our featured client testimonials.

    So much choice of curtains, material and accessories. Rose, the owner, is so professional and particularly helpful. I couldn\'t fault anything. I will definitely be buying again.

    Bernadette
    Dublin

    Excellent expertise, skill and a wonderful bespoke service with a high quality finish. A highly professional team whom I would recommend for any project.

    Siobhan
    Dublin

    Excellent selection of samples. Friendly and very professional member of staff, nothing was a problem. I would recommend a visit if you are looking for curtains or blinds.

    Frances
    Dublin

    ').insertAfter('#checkout_customer'); } }); /* Change Button text from 'Return to Homepage' to 'Homepage' */ $(document).ready(function() { $("#content > p > a").text(function () { return $(this).text().replace("Return to homepage", "Homepage"); }); }); /* Add Class to Contact Page */ $(function(){ if (window.location.pathname == "/contact-us/" || window.location.pathname == "/contact-us" || window.location.pathname == "/contact-us.html") { $('#container').addClass('contact'); } else { $('#container').removeClass('contact'); } }); /* Photo Gallery Page Layout */ $(function(){ if (window.location.pathname == "/showroom/" || window.location.pathname == "/showroom" || window.location.pathname == "/showroom.html") { $('.image_gallery, .wizzy').addClass('col-sm-12 col-md-6').wrapAll('
    '); } }); /* Wrap News Articles in Container */ $('.news_image, .news_panel').wrapAll('
    '); /* Wrap News Image */ $( ".news_image img" ).wrap( "
    " ); /* Wrap News Article Image */ $( ".news_article img" ).wrap( "
    " ); /* Add Current Date */ var months = ['January','February','March','April','May','June','July', 'August','September','October','November','December']; var tomorrow = new Date(); tomorrow.setTime(tomorrow.getTime() + (1000*3600*24)); document.getElementById("spandate").innerHTML = tomorrow.getFullYear(); /* Remove Footer Contact Duplications on Contact Us Page */ $(function(){ if (window.location.pathname == "/contact-us/" || window.location.pathname == "/contact-us" || window.location.pathname == "/contact-us.html") { $('#map-container').hide(); $('.footer-nav-container').addClass('zero-top-pad'); } }); /* Remove Space from Pagination */ jQuery.fn.cleanWhitespace = function() { textNodes = this.contents().filter( function() { return (this.nodeType == 3 && !/\S/.test(this.nodeValue)); }) .remove(); return this; }; $('.pagination').cleanWhitespace(); $('.rating-image').cleanWhitespace(); /*Colorbox Responsive Sizing*/ jQuery.colorbox.settings.maxWidth = '90%'; jQuery.colorbox.settings.maxHeight = '90%'; // ColorBox resize function var resizeTimer; function resizeColorBox() { if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { if (jQuery('#cboxOverlay').is(':visible')) { jQuery.colorbox.load(true); } }, 300); } // Resize ColorBox when resizing window or changing mobile device orientation /* jQuery(window).resize(resizeColorBox); */ window.addEventListener("orientationchange", resizeColorBox, false);