$(function() { $('a[href*=#]:not([href=#]):not(.pageTop a)').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 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; } } }); $('body').fadeMover({ 'effectType': 2, 'inSpeed': 800, 'outSpeed': 800, 'inDelay' : '0', 'outDelay' : '0', 'nofadeOut' : 'nonmover' }); $('.ticker ul').bxSlider({ pager: false, controls: false, ticker: true, speed: 60000, minSlides: 2, maxSlides: 25, slideWidth: 320 }); foo(); $(window).resize(function(){ if(!(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8.")){ foo(); } }); $('#main .product .section').bxSlider({ swipeThreshold: 100, oneToOneTouch: false }); /** $('.wallpaper .photoBox ul').carouFredSel({ auto: 1000, width: '100%', responsive: true, items: { visible: 1, minimum: 1, width: 86, height: 'variable' }, scroll: { items: 1, fx: 'crossfade', duration: 1000 } }); **/ $('.pageTop a').click(function () { $('body,html').animate({ scrollTop: 0 }, 1000); return false; }); }); /*function foo(){ if($(window).width() > 767){ $('.mainImg li').width(970).height(474); $('.mainImg ul').carouFredSel({ auto: 5000, width: '100%', items: { visible: 3, minimum: 1, width: 970, height: 474 }, scroll: { items: 1 }, prev: ".mainImg .prev", next: ".mainImg .next", pagination: '.mainImg .sliderPage' }); }else{ var w = $('.mainImg').width(); var h = 570/640*w; $('.mainImg li').width(w).height(h); $('.mainImg ul').carouFredSel({ auto: 5000, width: '100%', responsive: true, items: { visible: 1, minimum: 1, width: 570, height: 'variable' }, scroll: { items: 1 }, pagination: '.mainImg .sliderPage' }); $('.mainImg ul').swipe({ swipe: function(event, direction, distance, duration, fingerCount) { if(direction == 'left'){ $('.mainImg ul').trigger('next'); } else if(direction == 'right'){ $('.mainImg ul').trigger('prev'); } }, click: function(event, target) { $(target).click(); }, allowPageScroll: 'vertical', excludedElements: "button, input, select, textarea, a,.noSwipe", threshold: 75 }); } }*/ /* function foo() { $('.mainImg').css('visibility', 'hidden'); if ($(window).width() > 767) { $('.mainImg li').width(970).height(474); $('.mainImg ul').carouFredSel({ auto: 5000, width: '100%', items: { visible: 3, minimum: 1, width: 970, height: 474 }, scroll: { items: 1, direction: 'right' }, prev: ".mainImg .prev", next: ".mainImg .next", pagination: '.mainImg .sliderPage' }); } else { var w = $('.mainImg').width(); var h = 570 / 640 * w; $('.mainImg li').width(w).height(h); $('.mainImg ul').carouFredSel({ auto: 5000, width: '100%', responsive: true, items: { visible: 1, minimum: 1, width: w, height: h }, scroll: { items: 1 }, pagination: '.mainImg .sliderPage' }); $('.mainImg ul').swipe({ swipe: function (event, direction, distance, duration, fingerCount) { if (direction == 'left') { $('.mainImg ul').trigger('next'); } else if (direction == 'right') { $('.mainImg ul').trigger('prev'); } }, click: function (event, target) { $(target).click(); }, allowPageScroll: 'vertical', excludedElements: "button, input, select, textarea, a,.noSwipe", threshold: 75 }); } $('.mainImg').css('visibility', 'visible'); } $(document).ready(function () { foo(); }); $(window).resize(function () { foo(); });*/ function foo() { if ($(window).width() > 767) { $('.mainImg li').width(970).height(474); $('.mainImg ul').carouFredSel({ auto: 5000, width: '100%', items: { visible: 3, minimum: 1, width: 970, height: 474 }, scroll: { items: 1 }, prev: ".mainImg .prev", next: ".mainImg .next", pagination: '.mainImg .sliderPage', onCreate: function() { var $lastSlide = $('.mainImg ul li:last'); $('.mainImg ul').prepend($lastSlide); } }); } else { var w = $('.mainImg').width(); var h = 570 / 640 * w; $('.mainImg li').width(w).height(h); $('.mainImg ul').carouFredSel({ auto: 5000, width: '100%', responsive: true, items: { visible: 1, minimum: 1, width: 570, height: 'variable' }, scroll: { items: 1 }, pagination: '.mainImg .sliderPage', }); $('.mainImg ul').swipe({ swipe: function(event, direction, distance, duration, fingerCount) { if (direction == 'left') { $('.mainImg ul').trigger('next'); } else if (direction == 'right') { $('.mainImg ul').trigger('prev'); } }, click: function(event, target) { $(target).click(); }, allowPageScroll: 'vertical', excludedElements: "button, input, select, textarea, a,.noSwipe", threshold: 75 }); } }