var jQ = jQuery.noConflict(); jQ(function() { if( window.screen.availWidth >= 768 ){ jQ('head').append(''); } if( window.screen.availWidth < 768 ){ jQ('head').append(''); } return true; }); /* event more-views click see big image. */ function swap(image) { document.getElementById("image").src = image.href; jQ('#image-view').attr('href', image.href); jQ('#image').elevateZoom({ zoomType: "inner", cursor: "crosshair", zoomWindowFadeIn: 375, zoomWindowFadeOut: 375 }); } /* event when window resize or reload page product-view-name-sku change */ /* -------------------------------- */ /* web page reload */ jQ(document).ready(function() { var widthwindow1 = jQ(window).width(); var currentTime = new Date(); var year = currentTime.getFullYear(); var htmlyear = 'Copyright '+ year+' OzPlaza'; jQ('.footer-container .footer-container-top .block-footer-top.right p').html(htmlyear); jQ('.search-content form').attr("action","http://stores.ebay.com.au/ozplazaliving"); jQ('#image-view').click(function () {return false;}); jQ(".product-thumb .thumb-content .thumb img").each(function(index) { if (jQ(this).attr('src') == '') { jQ(this).parent().parent().hide(); } }); jQ(".cat-box ul li a img").each(function(index) { if (jQ(this).attr('src') == '') { jQ(this).parent().parent().hide(); }else if (jQ(this).attr('src') != ''){ jQ("#horizontalTab").addClass('tab-style'); } }); jQ(".feature-container ul li img").each(function(index) { if (jQ(this).attr('src') == 'http://www.i-wholesale.com.au/ebay_lisitng_pic/testing/TESTING-') { jQ(this).parent().hide(); } }); /* menul mobile*/ jQ(".icon-menu-mb").click(function(){ jQ(this).toggleClass("active"); jQ(".menu-container .menu-content").slideToggle(); }); jQ('.menu-container .menu-content ul.menu li .sub-category').parent().addClass('par'); jQ('.menu li:has(ul)').addClass('hassub'); jQ(".child-level-1.hassub .sub-category").before("
"); jQ(".child-level-2.hassub .sub-category2").before(""); if(widthwindow1 > 768){ jQ(".menu-container .menu-content .hassub.child-level-1 > .icon").click(function(){ if(jQ(this).parent('.is-active').length){ jQ(this).removeClass('acti'); jQ(this).parent().removeClass('is-active'); }else{ jQ('.menu-container .menu-content ul.menu li.child-level-1 > .icon').removeClass('acti'); jQ('.menu-container .menu-content ul.menu li.child-level-1').removeClass('is-active'); jQ('.menu-container .menu-content ul.menu li.child-level-2 > .icon').removeClass('acti'); jQ('.menu-container .menu-content ul.menu li.child-level-2').removeClass('is-active'); jQ(this).parent().addClass('is-active'); jQ(this).addClass("acti"); } }); jQ(".menu-container .menu-content .hassub.child-level-2 .icon").click(function(){ if(jQ(this).parent('.is-active').length){ jQ(this).removeClass('acti'); jQ(this).parent().removeClass('is-active'); }else{ jQ('.menu-container .menu-content ul.menu li.child-level-2.is-active > .icon').removeClass('acti'); jQ('.menu-container .menu-content ul.menu li.child-level-2.is-active').removeClass('is-active'); jQ(this).parent().toggleClass('is-active'); jQ(this).toggleClass("acti"); } }); }else{ jQ(".menu-container .menu-content .hassub .icon").click(function(){ jQ(this).parent().toggleClass('is-active'); jQ(this).toggleClass("acti"); }); } jQ(".menu-container .menu-content ul.menu li.child-level-1.par span").click(function(){ jQ(this).next().slideToggle(); jQ(this).toggleClass('active'); }); jQ(".feature-container ul li").each(function( index ) { if(index == 0){jQ(this).addClass("first");} if(index == 1 ){ jQ(this).addClass("two"); } }); jQ(".feature-container ul li").each(function( index ) { if(index == 1 ){ jQ(this).addClass("feature-desktop"); } }); jQ(window).on("orientationchange load resize",function() { var widthwindow1 = jQ(window).width(); var window_fle = widthwindow1 -20; var flexisel = jQ(".nbs-flexisel-container"); flexisel.css({"width": window_fle+"px"}); if (widthwindow1 < 640) { jQ(".cat-level0").insertAfter(jQ(".logo-footer")); }else{ jQ(".cat-level0").insertBefore(jQ(".block-footer-top.right p")); } }); if(widthwindow1 < 768){ jQ('.wrappage .header-container').after(jQ('.wrappage .menu-container')); } jQ(".bxslider-feature-product").flexisel({ visibleItems: 4, animationSpeed: 1000, enableResponsiveBreakpoints: true, responsiveBreakpoints: { portrait: { changePoint:480, visibleItems: 1 }, landscape: { changePoint:640, visibleItems: 2 }, tablet: { changePoint:768, visibleItems: 3 } } }); //tabs jQ('#horizontalTab').easyResponsiveTabs({ type: 'default', //Types: default, vertical, accordion width: 'auto', //auto or any width like 600px fit: true, // 100% fit in a container closed: 'accordion', // Start closed if in accordion view activate: function(event) { // Callback function if tab is switched var tab = jQ(this); var info = jQ('#tabInfo'); var name = jQ('span', info); name.text(tab.text()); info.show(); } }); jQ('#horizontalTab1').easyResponsiveTabs({ type: 'default', //Types: default, vertical, accordion width: 'auto', //auto or any width like 600px fit: true, // 100% fit in a container closed: 'accordion', // Start closed if in accordion view activate: function(event) { // Callback function if tab is switched var tab = jQ(this); var info = jQ('#tabInfo'); var name = jQ('span', info); name.text(tab.text()); info.show(); } }); jQ("#horizontalTab .resp-tab-content").first().addClass("resp-tab-content-active"); jQ("#horizontalTab .resp-accordion").first().addClass("resp-tab-active"); jQ("#horizontalTab1 .resp-tab-content").first().addClass("resp-tab-content-active"); jQ("#horizontalTab1 .resp-accordion").first().addClass("resp-tab-active"); jQ(".resp-tabs-container h2").each(function() { var str = jQ(this).text(); if(str == "Description"){ jQ(this).addClass("dsc-title"); } if(str == "Features"){ jQ(this).addClass("feature"); } if(str == "Specifications"){ jQ(this).addClass("spec-title"); } if(str == "Package Content"){ jQ(this).addClass("package-title"); } if(str == "Payment & Shipping"){ jQ(this).addClass("shipping"); } if(str == "Returns"){ jQ(this).addClass("Returns"); } if(str == "Warranty"){ jQ(this).addClass("Warranty"); } }); jQ( ".resp-tabs-list li" ).on( "mouseenter", function() { //jQ(this).trigger( "click" ); }); jQ('.lazy-image').lazyload({ event : "sporty" }); var timeout = setTimeout(function() { jQ(".lazy-image").trigger("sporty"); }, 3000); var w_wrappage = jQ(".wrappage").width(); if (w_wrappage < 1200) { jQ(".wrappage").addClass("has-lech"); }; // Add Class Myanchor jQ(".header-container").attr("id","myAnchor"); jQ(".footer-container").after(''); /*Add class when scroll down*/ jQ(window).scroll(function(event){ var scroll = jQ(window).scrollTop(); if (scroll >= 50) { jQ(".go-top").addClass("show"); } else { jQ(".go-top").removeClass("show"); } }); /*Animation anchor*/ jQ('.go-top').click(function(){ jQ('html, body').animate({ scrollTop: jQ("#myAnchor").offset().top }, 1000); }); if(widthwindow1 < 768){ jQ('#horizontalTab1 .resp-accordion.feature').hide(); jQ('#horizontalTab .resp-accordion.shipping').removeClass('resp-tab-active'); jQ('#horizontalTab .resp-tab-content').first().removeClass('resp-tab-content-active'); if(jQ('#horizontalTab .resp-tabs-container h2.show-title-tab').length){ jQ('#horizontalTab .shipping').click(function(){ jQ(this).addClass('resp-tab-active'); jQ(this).addClass('show-title-tab'); jQ('#horizontalTab .resp-tab-content').first().addClass('resp-tab-content-active'); }); }else{ jQ('#horizontalTab .show-title-tab').click(function(){ jQ(this).removeClass('resp-tab-active'); jQ(this).removeClass('show-title-tab'); jQ('#horizontalTab .resp-tab-content').first().removeClass('resp-tab-content-active'); }); } } jQ('.feature-container ul li').each(function(){ if(jQ(this).children('img').attr('src') == ""){ jQ(this).hide(); } }); jQ('a img').each(function(){ if(jQ(this).attr('src') == ""){ jQ(this).parent().hide(); } }); jQ(".v5sbox").attr("type",""); jQ(".search-content .v4sbox").keyup(function(e) { var param = jQ('.search-content .v4sbox').val(); if (param != '') { var str = "http://stores.ebay.com.au/ozplazaliving?_nkw=" + param +"&_in_kw=1&_ex_kw=&_sacat=0&_udlo=&_udhi=&LH_BIN=1"; jQ(this).trigger("enterKey"); window.top.location.href = str; } }); }); function GetItemID() { var path = window.location.href; //alert(path); var itemID = ""; var count = 0; for (i = 1; i < path.length; i++) { if (count != 12) { if ((path[i] == '0') || (path[i] == '1') || (path[i] == '2') || (path[i] == '3') || (path[i] == '4') || (path[i] == '5') || (path[i] == '6') || (path[i] == '7') || (path[i] == '8') || (path[i] == '9')) { itemID += path[i]; count++; } else { if (count != 12) { itemID = ""; count = 0; } } } } return itemID; } function SendMessage() { var str = "http://contact.ebay.com.au/ws/eBayISAPI.dll?FindAnswers&redirect=0&iid="+GetItemID()+"&requested=ozplaza.living"; window.top.location.href = str; } function AddWatchList() { var str = "http://cgi1.ebay.com.au/ws/eBayISAPI.dll?MakeTrack&item=" + GetItemID(); window.top.location.href = str; } function AddToCart() { var str = "http://offer.ebay.com.au/ws/eBayISAPI.dll?BinConfirm&rev=1&item=" + GetItemID(); window.top.location.href = str; } function BidNow() { var str = "http://offer.ebay.com.au/ws/eBayISAPI.dll?MakeBid&item=" + GetItemID(); window.top.location.href = str; } function TellFriend() { var str = "http://contact.ebay.com.au/ws1/eBayISAPI.dll?ShowEmailAuctionToFriend&item=" + GetItemID(); window.top.location.href = str; } function buynow2() { var url = 'http://www.ebay.com.au/itm/' +GetItemID(); window.top.location.href = url; }