document.documentelement.classname += ' js_active '; document.documentelement.classname += 'ontouchstart' in document.documentelement ? ' vc_mobile ' : ' vc_desktop '; (function(){ var prefix = ['-webkit-','-o-','-moz-','-ms-',""]; for (var i in prefix) { if(prefix[i]+'transform' in document.documentelement.style) document.documentelement.classname += " vc_transform "; } })(); function image_lazy_event(){ if(jquery("[data-delay-image='1']").length>0){ jquery("[data-delay-image='1']").lazy( { effect:'fadein', effecttime:400, threshold: 800, } ); } } function hextorgb(hex) { if(hex=="transparent") return "transparent"; var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseint(result[1], 16), g: parseint(result[2], 16), b: parseint(result[3], 16) } : null; } function vc_js_init(){ //bind slidercontent if(!is_edit_model) { if (jquery(".qfy-element.qfy-slidercontent").length > 0 && jquery("a[href^='qfylinked_']").length > 0) { jquery("a[href^='qfylinked_']:not(.loaded)").each(function () { jquery(this).addclass("loaded"); var url = jquery(this).attr("href"); url = url.replace("%5e", "^").replace("%5e", "^"); if (url.indexof("^") > -1) { url = url.substr(10); var url_tmp = url.split("^"); var uuid = url_tmp[0]; var type = url_tmp[1]; var to = url_tmp[2]; if (uuid) { var obj = jquery("[qfyuuid='" + uuid + "']>.royalslider_gallery_new"); if (obj.length > 0) { if (type == "1") { jquery(this).click(function (e) { e.preventdefault(); e.stoppropagation(); }).mouseenter(function (e) { var slider = obj.data('royalslider'); slider.goto(to - 1); }); } else { jquery(this).click(function (e) { e.preventdefault(); e.stoppropagation(); var slider = obj.data('royalslider'); slider.goto(to - 1); }); } } } } }); } // if (jquery(".qfy-element.qfe_gallery").length > 0 && jquery("a[href^='qfyrelaed_']").length > 0) { jquery("a[href^='qfyrelaed_']:not(.loaded)").each(function () { jquery(this).addclass("loaded"); var url = jquery(this).attr("href"); url = url.replace("%5e", "^").replace("%5e", "^"); if (url.indexof("^") > -1) { url = url.substr(10); var url_tmp = url.split("^"); var uuid = url_tmp[0]; var type = url_tmp[1]; var to = url_tmp[2]; if (uuid) { if (type == "1") { jquery(this).click(function (e) { e.preventdefault(); e.stoppropagation(); }).mouseenter(function (e) { var obj = jquery("[qfyuuid='" + uuid + "'] .royalslider_gallery"); if (obj.length > 0) { var slider = obj.data('royalslider'); slider.goto(to - 1); } else if (jquery("[qfyuuid='" + uuid + "'] .qfe_flexslider").length > 0) { jquery("[qfyuuid='" + uuid + "'] .qfe_flexslider").flexslider(to - 1); } else if (jquery("[qfyuuid='" + uuid + "'] .swiper-container").length > 0) { jquery("[qfyuuid='" + uuid + "'] .swiper-container").data('swiper').slideto(to); } }); } else { jquery(this).click(function (e) { e.preventdefault(); e.stoppropagation(); var obj = jquery("[qfyuuid='" + uuid + "'] .royalslider_gallery"); if (obj.length > 0) { var slider = obj.data('royalslider'); slider.goto(to - 1); } else if (jquery("[qfyuuid='" + uuid + "'] .qfe_flexslider").length > 0) { jquery("[qfyuuid='" + uuid + "'] .qfe_flexslider").flexslider(to - 1); } else if (jquery("[qfyuuid='" + uuid + "'] .swiper-container").length > 0) { jquery("[qfyuuid='" + uuid + "'] .swiper-container").data('swiper').slideto(to); } }); } } } }); } } // begin if(jquery(".swiper-container:not(.loaded)").length>0){ if(typeof jquery.fn.swiper=="undefined"){ jquery.ondemandscript("/feieditor/bitsite/js/swiper/swiper-4.1.0.min.js",function() { jquery('head').append(''); swiper_event(); }) }else{ swiper_event(); } } image_lazy_event(); vc_3d_photo(); lottieready(jquery); shape_ready(); jquery("#shopping-cart-bitcommerce .carsize:not(.pulse1)").addclass("pulse1"); jquery(".srollupdown:not(.load)").each(function(){ jquery(this).addclass("load"); var all = jquery(this).attr("data-scroll-all"); var num = jquery(this).attr("data-scroll-num"); var speed = jquery(this).attr("data-scroll-speed"); var delay = jquery(this).attr("data-scroll-delay"); var slidebox = jquery(this).find("ul:first"); var allheight = slidebox.css("height").replace("px","")*1; var delay = delay||1000,speed = speed||20; var tid = null,pause = false; var s = function(){ slidebox.attr("style","overflow:hidden !important;height:"+allheight+"px;");slidebox.find("li").removeclass("displaynone");tid=setinterval(slide_scroll, speed); } var slide_scroll = function(){ if(pause) return; slidebox.scrolltop(slidebox.scrolltop()+ 2); var scrolltop = slidebox.scrolltop(); if(num>1){ var first_height = 0; var marginbottom = 0; slidebox.find("li").each(function(i){ if(i=first_height*1+marginbottom*1){ clearinterval(tid); if(num>1){ slidebox.find("li").each(function(i){ if(i-1){ imageurl = imageurl.replace("http://","//"); } var title = jquery(this).attr("op-title"); var data_pop = jquery(this).attr("op-style"); var titlealign = jquery(this).attr("op-titlealign"); var stylealign = jquery(this).attr("op-stylealign"); var tiptitle= ""; var download = false; if(imageurl){ tiptitle +=""; } if(title){ tiptitle +="
"+title+"
"; } if(stylealign){ var data = { tipjoint:stylealign, fixed:true,style: data_pop }; }else{ var data = { style: data_pop }; } if(imageurl){ jquery("").attr("src", imageurl).load(function(){ settimeout(function(){new opentip( $this, tiptitle, data);},1500); }) $this.addclass("played"); }else{ new opentip( $this, tiptitle, data); $this.addclass("played"); } }) if( jquery('.qfy-jiathis').length>0){ if(typeof jquery.fn.share !="function"){ jquery.ondemandscript("/feieditor/bitsite/js/share/jquery.share.min.js",function() { jquery('head').append(''); jquery('.qfy-jiathis .share').share(); }) }else{ jquery('.qfy-jiathis .share').share(); } } var video_len = jquery('.video.preload:not(.played)').length; if(video_len>0){ jquery('.video.preload:not(.played)').each(function(){ if(jquery("body").width()<760 && video_len==1 ){ jquery(this).addclass("played").attr("src",jquery(this).attr("data-src")); }else{ jquery(this).waypoint({ handler: function(direction) { jquery(this).addclass("played").attr("src",jquery(this).attr("data-src")); }, triggeronce: true, offset: "95%", }) } }) } vc_royalslider_gallery_init(); if(!is_edit_model){ accordioncontent(); } if( jquery('.qfy-accordioncontent').length>0){ if(typeof accordioncontent_init !="function"){ jquery.ondemandscript("/qfy-content/themes/qfy-01/js/a-accord.js",function() { accordioncontent_init(); }); }else{ accordioncontent_init(); } } jquery( ".dl-qfymobile-menu:not(.loaded)" ).each(function(){ var backcap = jquery(this).find(".menu-back").html(); jquery(this).find(".children.dl-submenu").prepend(""); jquery(this).addclass("loaded").dlmenu(); }) if(!is_edit_model){ jquery( ".background-media.mediagallery:not(.loaded)" ).each(function(){ var $this = jquery(this); jquery(this).addclass("loaded on"); var imagebgs = jquery(this).attr("data-imagebgs"); var imagebgs_arr = imagebgs.split("|^|"); var imagebgs_count = imagebgs_arr.length; var imagebgs_current = 0; var time = jquery(this).attr("data-time")?jquery(this).attr("data-time"):3; var thishtml = $this.prop("outerhtml"); var tmp = ""; for(var i=0;i.background-media'); }else{ var p_class= p.attr("class"); var tmpclass = p_class.split(" "); var currclass = ""; for(var i =0;i-1){ currclass = tmpclass[i]; } } if(currclass){ imagebgs_current = p.find(".background-media.on").index('.'+currclass+' .background-media'); }else{ imagebgs_current = p.find(".background-media.on").index('.background-media'); } } p.find(".background-media.on").removeclass("on").css({'opacity':'0'}) if(imagebgs_current==imagebgs_count-1){ p.find(".background-media:eq(0)").addclass("on").css({'opacity':'1'}); }else{ p.find(".background-media:eq("+(imagebgs_current+1)+")").addclass("on").css({'opacity':'1'}); } },time*1000); }) if(jquery(".qfy-comments .commentlist:hidden").length>0){ jquery(".qfy-comments").each(function(){ var p = jquery(this); if(p.find(".commentlist:visible").length>0) return; var loadhtml = "
"; p.find(".commentlist").after(loadhtml); var form =p.find("form#commentform"); var comment_post_id = form.find("#comment_post_id").val(); var url = form.attr("action"); jquery.post(url,{action:"search",comment_post_id:comment_post_id,short_atts:p.attr("data-atts")},function(data){ if(data.indexof("success")>-1){ var tmp = data.split('||'); var commentlist = $(tmp).find(".commentlist"); p.find(".commentlist").html(commentlist.html()); } p.find(".commentlist").show(); p.find(".commentlist_loading").remove(); }) }) } } if(typeof qfy_canvas_animale_run=="function"){ qfy_canvas_animale_run(); } var objs = jquery(".qfy-icons_list .qfy-icon"); objs.each(function(){ var obj = jquery(this); var name = obj.attr("data-desc"); var bg = obj.attr("data-bg"); var bgstyle= ""; if(bg ){ bgstyle = "background:"+bg+";margin:-20px;padding:20px;"; } var image = obj.attr("data-image"); var tj = obj.attr("data-tj")=="0"?"top":"bottom"; var ta = obj.attr("data-ta"); var width = obj.attr("data-width"); var align="left"; if(ta=="1") align="right"; else if(ta=="2") align="center"; obj.attr("title", ''); var text = ""; if(name){ text ="
"+base64_decode(name)+"
"; } if(image){ if(width){ var title ="
"+text+"
"; }else{ var title ="
"+text+"
"; } var img = new image(); img.onload = img.onerror =function() { var data = { tipjoint: tj,style: "dark" }; settimeout(function(){ new opentip(obj, title, data); },300); }; img.src = image; }else if(text){ if(width){ var last = "
"+text+"
"; }else{ var last = "
"+text+"
"; } var data = { tipjoint: tj,style: "dark" }; new opentip(obj, last, data); } }) jquery(".qfyvideo").unbind().mouseenter(function(){ if(! jquery(this).parent().hasclass("list_popup")){ jquery(this).get(0).play(); } }).mouseleave(function(){ if(! jquery(this).parent().hasclass("list_popup")){ if(jquery(this).get(0).currenttime>0){ jquery(this).get(0).load(); } } }) jquery('[data-ride="vc-carousel"]').each(function(){ qfy_carousel_fun(jquery(this)) }) jquery(".qfy_scroll_box:not(.load)").each(function(){ jquery(this).addclass("load"); var box = jquery(this).attr("id"); var delay = jquery(this).attr("data-delay"); var speed = jquery(this).attr("data-speed"); var h = jquery(this).attr("data-h"); slideline(box,"div",delay,speed,h); }); if(!is_edit_model){ jquery("a[href^='qfy_notice']").each(function(){ var id = jquery(this).attr("href"); jquery(this).attr("data-href",id); jquery(this).removeattr("href"); jquery(this).unbind().click(function(e){ e.preventdefault(); e.stoppropagation(); if(jquery("#"+id).length>0){ notice_pre_event("#"+id+" .notice_warp","preview"); } }) }); }else{ jquery("a[href^='qfy_notice']").unbind().click(function(e){ e.preventdefault(); e.stoppropagation(); var id = jquery(this).attr("href"); if(jquery("#"+id).length>0){ notice_pre_event("#"+id+" .notice_warp","preview"); } }) } jquery(".qfyanimate:not(.qfyanimated)").each(function(){ var animaleinbegin = jquery(this).attr("data-animaleinbegin"); if(!animaleinbegin) animaleinbegin = "bottom-in-view"; jquery(this).waypoint({ handler: function(direction) { var delay = jquery(this).attr("data-delay"); var duration = jquery(this).attr("data-duration"); if(delay===""){ // 列使用 if(jquery(this).hasclass("qfy-column-inner")){ delay = jquery(this).index()*0.1/2; } } var animalename = jquery(this).attr("data-animalename"); if(duration){ jquery(this).css("animation-duration",duration+"s"); } jquery(this).css("animation-delay",delay+"s").css("animation-name",animalename).css("visibility","visible"); jquery(this).addclass("qfyanimated"); }, triggeronce: true, offset: animaleinbegin, }) }) jquery(".clippathanimate:not(.clippathanimated)").each(function(){ jquery(this).waypoint({ handler: function(direction) { jquery(this).addclass("clippathanimated"); }, offset: "bottom-in-view", }) }); if( jquery(".auto_tab_menu").length>0){ jquery(".auto_tab_menu").each(function(){ auto_tab_menu(jquery(this)); }); } typed_event(); prenext_event(); // end } function vc_js_init2(){ // console.trace(); init_usermange_detail(); vc_slidersbehaviour(); vc_waypoints(); vc_teasergrid(); vc_carouselbehaviour(); vc_plugin_flexslider(); resizefullpageheader(); bitliblayout(); bit_circliful(); bit_counter(); bit_counterdown(); bit_newgallery(); qfy_jplayer_init(); bit_myaccountlayout(); bit_qfbook(); bit_qfbookform(); settimeout(function(){ bit_reloadiframevideo();},1000); } var is_edit_model = false; try{ if( parent.jquery("#vc-inline-frame").length==1 ){ is_edit_model = true; } }catch(e){ } jquery(document).ready(function($) { if(!is_edit_model){ vc_js_init(); vc_js_init2(); } jquery(document).click(function(e) { if(jquery("body.clicktoaddmodel").length>0){ var target = jquery(e.target); if(target.closest(".vc-element.vc-vc_row").length==0){ jalert("亲,您点在了不能插入区块的地方。请选择内容区域的一个区块。"); return false; } } }); }); // end jquery(document).ready jquery(window).resize(function() { // 手机上滚动会触发这个resize var body_width = jquery("body").width(); if(body_width>768){ bitliblayout(); } var maxwidth = 0; jquery(".qfe_gallery .qfe_gallery_slides").find('img').each(function(){ if(jquery(this).width()>maxwidth){ maxwidth = jquery(this).width(); } }) if(maxwidth>body_width) { vc_plugin_flexslider(); } }); jquery(window).on("debouncedresize", function() { jquery(".ts-circliful-counter").each(function() { if ("true" == jquery(this).attr("data-responsive")) { var t = jquery(this), e = parseint(jquery(this).parent().width()), a = parseint(jquery(this).attr("data-size")); e != a && (t.empty(), t.circliful()) } }) }); function resizefullpageheader(){ if(jquery(".bit-html .fullscreenpage.fullpage_layout2").length>0||jquery(".bit-html .fullscreenpage.fullpage_layout3").length>0||jquery(".bit-html .fullscreenpage.fullpage_layout4").length>0){ jquery(".bit-html .fullscreenpage #fullscreenheader").css("margin-top","-"+(jquery(".bit-html .fullscreenpage #fullscreenheader").height()/2)+"px"); } } function typed_event(){ if(jquery(".qfy-simple_header:not(.loaded)").length==0) return; if(typeof typed!="function"){ jquery.ondemandscript("/feieditor/bitsite/js/typed.min.js",function() { _typed_event(); }) }else{ _typed_event(); } } function prenext_event(){ var lrmiddlelayout = jquery("#page .lrmiddlelayout:first:not(.loaded)"); var body_width = jquery("body").width(); if(lrmiddlelayout.length>0 ){ lrmiddlelayout.addclass("loaded"); jquery(".lrmiddlelayout.wrap").remove(); var pre_html = '
'; pre_html += lrmiddlelayout.find(".pre_inner").prop("outerhtml"); pre_html += '
'; var next_html = '
'; next_html += lrmiddlelayout.find(".next_inner.first").prop("outerhtml"); next_html += '
'; if(lrmiddlelayout.hasclass("mobilehidden") && body_width<768){ }else if(lrmiddlelayout.hasclass("desktophidden") && body_width>768){ }else{ jquery("body").append(pre_html+next_html); } } if( jquery("#page .lrmiddlelayout").length==0){ jquery(".lrmiddlelayout.wrap").remove(); } } function bit_circliful(obj){ if( "undefined" != typeof obj ){ obj = obj.find(".ts-circliful-counter:not(.loaded)"); }else{ obj = jquery(".ts-circliful-counter:not(.loaded)"); } if(obj.length==0) return; if(typeof jquery.fn.circliful=="undefined"){ jquery.ondemandscript("/qfy-content/plugins/qfy_editor/js/jquery.circliful.min.js",function() { _bit_circliful(obj); }) }else{ _bit_circliful(obj); } } function _bit_circliful(obj){ "undefined" != typeof jquery.fn.waypoint && "undefined" != typeof jquery.fn.circliful && obj.each(function() { jquery(this).bind("inview", function(t, e, a, i) { if (e) { var r = jquery(this); "top" == i || "bottom" == i || r.addclass("ts-circliful-visible") } else { var r = jquery(this); r.removeclass("ts-circliful-visible") } }) jquery(this).addclass("loaded").circliful(); }); } function formatnumber(s,o){ s = s+""; if(/[^0-9\.]/.test(s)) return false; s=s.replace(/^(\d*)$/,"$1."); s=s.replace(".",o); var re=/(\d)(\d{3},)/; while(re.test(s)) s=s.replace(re,"$1,$2"); s=s.replace(/,(\d\d)$/,".$1"); s=s.substring(0,s.length-1); return s; } function bit_counter(obj){ if( "undefined" != typeof obj ){ obj = obj.find(".ts-icon-counter"); if(obj.length==0) return false; }else{ obj = jquery(".ts-icon-counter"); } if(obj.length==0) return; if(typeof jquery.fn.countto=="undefined"){ jquery.ondemandscript("/qfy-content/plugins/qfy_editor/js/jquery.countto.min.js",function() { _bit_counter(obj); }) }else{ _bit_counter(obj); } } function bit_newgallery(obj){ if( "undefined" != typeof obj ){ obj = obj.find(".royalslider_gallery"); if(obj.length==0) return false; }else{ obj = jquery(".royalslider_gallery"); } if(obj.length==0) return; if(typeof jquery.fn.royalslider=="undefined"){ jquery.ondemandscript("/feieditor/bitsite/js/jquery.royalslider.min.js",function() { _bit_newgallery(obj); }) }else{ _bit_newgallery(obj); } } function fullscreenclick(obj){ jquery(obj).closest(".royalslider_gallery").find(".rsfullscreenicn").click(); } function bit_myaccountlayout(){ var defaultindex=getcookie("qfy_order_index"); if(jquery(".qfy_account.tablayout").length>0 && jquery(".qfy_account.tablayout.ontab").length==0){ jquery(".qfy_account > .bitcommerce").append('
    '); jquery(".qfy_account .my_account_orders_h2").each(function(i){ var name = jquery(this); var content = jquery(this).next(); if(content.hasclass("my_account_orders_h2")||content.hasclass("bitcommerce-tabs-info")||content.length==0){ content_html = '
    '; }else{ content_html = content.prop('outerhtml'); content.remove(); } jquery( '.bitcommerce-tabs-info ul.tabs' ).append('
  • '+name.text()+'
  • '); jquery( '.bitcommerce-tabs-info ul.tabs' ).after('
    '+content_html+'
    '); name.remove(); }); jquery(".qfy_account.tablayout").addclass("ontab"); var titlesize = jquery(".qfy_account.tablayout").attr("data-size"); if(titlesize){ jquery( '.bitcommerce-tabs-info ul.tabs li a' ).css("font-size",titlesize+"px"); } jquery( '.bitcommerce_account_subscriptions').hide(); jquery( '.bitcommerce-tabs-info .panel' ).hide(); jquery( '.bitcommerce-tabs-info ul.tabs li a' ).click( function() { var $tab = jquery( this ), $tabs_wrapper = $tab.closest( '.bitcommerce-tabs-info' ); jquery( 'ul.tabs li', $tabs_wrapper ).removeclass( 'active' ); jquery( 'div.panel', $tabs_wrapper ).hide(); jquery( 'div' + $tab.attr( 'href' ), $tabs_wrapper).show(); $tab.parent().addclass( 'active' ); var index = $tab.parent().index(); qfy_setcookie("qfy_order_index",index); return false; }); if(defaultindex>0){ jquery( '.bitcommerce-tabs-info ul.tabs li:eq('+defaultindex+') a' ).click(); }else{ jquery( '.bitcommerce-tabs-info ul.tabs li:first a').click(); } } } function bit_qfbook(){ settimeout(function(){ jquery(".qfbookcalendar-text-message").each(function(){ var $this = jquery(this); var id = $this.attr("id"); var val = $this.val(); jquery("#qfbookcalendar"+id).qfbookcalendar(jquery.parsejson(val)); }) jquery(".qfbookcalendar-search-message").each(function(){ var $this = jquery(this); var id = $this.attr("id"); var val = $this.val(); jquery(".qfbooksearch-wrapper"+id).qfbooksearch(jquery.parsejson(val)); }) },500) } function bit_qfbookform(){ if(jquery('#qfbooksearch-check-in-input').length>0){ jquery('#qfbooksearch-check-in-input').datepicker({mindate: new date(), onselect:function(datetext,inst){ jquery("#qfbooksearch-check-out-input").datepicker("option","mindate",datetext); }}); } if(jquery('#qfbooksearch-check-out-input').length>0){ jquery('#qfbooksearch-check-out-input').datepicker({mindate: new date(), onselect:function(datetext,inst){ jquery("#qfbooksearch-check-in-input").datepicker("option","maxdate",datetext); }}); } } function bit_reloadiframevideo(time){ if(jquery("div.ts_html5_video_frame_insert").length>0){ jquery("div.ts_html5_video_frame_insert").each(function(){ var $this = jquery(this); var auto_play = $this.attr("data-auto-play"); if(auto_play=="true") { $this = $this.changetag("iframe"); }else if(auto_play=="2"){ $this.parent().mouseenter(function(){ $this.changetag("iframe").attr("data-auto-play","true"); }); }else if(auto_play=="3"){ $this.waypoint(function () { $this.changetag("iframe").attr("data-auto-play","true"); }, {offset: '85%'}); }else{ $this.unbind().click(function(){ $this.changetag("iframe").attr("data-auto-play","true"); }) } }) } if(jquery(".ts_html5_video_frame .video-box video.visible_play").length>0){ jquery(".ts_html5_video_frame .video-box video.visible_play").each(function(){ var video = jquery(this).get(0); jquery(this).waypoint(function () { if (video.paused === false) { video.pause(); } else { video.play(); } }, {offset: '85%'}); }); } } function qfy_jplayer_init(){ if( jquery(".vc_jplayer_container:not(.played)").length==0) return; if(typeof jquery.fn.videoplayer=="undefined"){ jquery.when( jquery.getscript( "/feieditor/bitsite/js/jsplayer/jplayer/jquery.jplayer.min.js" ), jquery.getscript( "/feieditor/bitsite/js/jsplayer/jplayer/jplayer.cleanskin.js" ), jquery.deferred(function( deferred ){ jquery( deferred.resolve ); }) ).done(function(){ _qfy_jplayer_init(); }); }else{ _qfy_jplayer_init(); } } function _qfy_jplayer_init(){ // 音频 jquery(".vc_jplayer_container:not(.played)").each(function(){ var title = jquery.trim(jquery(this).find(">.audio-info").html()); var mp3 = jquery(this).find(">.audio-info").attr("data-mp3"); var autoplay = jquery(this).find(">.audio-info").attr("data-auto"); if(autoplay!=1) autoplay=null; var loop = jquery(this).find(">.audio-info").attr("data-loop"); if(loop==1){loop=true;}else{loop=false;}; jquery(this).find('>.webplayer').videoplayer({ "name": title, "autoplay":autoplay, "keyenabled":false, "loop":loop, "swfpath":"/feieditor/bitsite/js/jsplayer/jplayer", "size": {"width": "100%",}, "media": {"mp3": mp3} }); jquery(this).addclass("played"); }) } function bit_counterdown(){ if(jquery(".ts-countdown-parent").length==0) return; if(typeof jquery.fn.counteverest=="undefined"){ jquery.ondemandscript("/feieditor/bitsite/js/jquery.vcsc.counteverest.min.js",function() { jquery('head').append(''); _bit_counterdown(); }) }else{ _bit_counterdown(); } } function bitliblayout(obj){ jquery(".old-ie [backgroundsize='true']").css({backgroundsize: "cover"}); if (typeof obj === 'undefined') { obj = jquery(".qfe_images_lib_isotope") } obj.each(function () { var current_obj = jquery(this); var curr_action = current_obj.attr("data-liblayout"); var filter = jquery(this).parent().find(".isotope_image"); filter.each(function(){ jquery(this).unbind("click").bind("click",function(){ var f = jquery(this).attr("data-filter"); var c = jquery(this).closest(".vcgroup").attr("data-color"); var hc = jquery(this).closest(".vcgroup").attr("data-hovercolor"); filter.removeclass("on"); filter.css("color",c); jquery(this).addclass("on"); jquery(this).css("color",hc); if(curr_action=="" || curr_action=="undefined"){ current_obj.find(">.vc-item").hide(); current_obj.find(f).show(); }else{ current_obj.isotope({ filter: f }); } }).bind("mouseover",function(){ var hc = jquery(this).closest(".vcgroup").attr("data-hovercolor"); if( !jquery(this).hasclass("on")){ jquery(this).css("color",hc); } }).bind("mouseout",function(){ var c = jquery(this).closest(".vcgroup").attr("data-color"); if( !jquery(this).hasclass("on")){ jquery(this).css("color",c); } }) }); }); if(typeof jquery.fn.isotope!="undefined") { var action = obj.attr("data-liblayout"); var columnwidth = obj.attr("data-width"); if (obj.length == 0 || action == "" || action == "undefined") { return false; } obj.isotope({ itemselector: '.vc-item', layoutmode: action, filter: ".images,.templates" }); var all_load = true; obj.find('img').each(function () { if (!jquery(this).prop('complete')) { all_load = false; } }); if (!all_load) { window.settimeout(function () { bitliblayout(obj); }, 500); return; } obj.isotope("relayout"); } } if ( typeof window['vc_plugin_flexslider'] !== 'function' ) { function vc_plugin_flexslider() { if (jquery('.qfe_flexslider').length == 0) return; if (typeof jquery.fn.flexslider == "undefined") { jquery.ondemandscript("/qfy-content/plugins/qfy_editor/assets/lib/flexslider/jquery.flexslider-min.js",function () { jquery('head').append(''); _vc_plugin_flexslider(); }) } else { _vc_plugin_flexslider(); } } } function qfy_carousel_fun($carousel) { var is_carousel_ok = true; $carousel.find('img').each(function () { if (!jquery(this).prop('complete')) { is_carousel_ok = false; } }) if (!is_carousel_ok) { window.settimeout(function () { qfy_carousel_fun($carousel); }, 500); return; } $carousel.carousel($carousel.data()); } /* * waypoints magic ---------------------------------------------------------- */ if (typeof window['vc_waypoints'] !== 'function') { function qfe_animate_fun($this) { var p = jquery($this).closest(".qfy-element"); var delay = p.attr("css_animation_delay"); var anitime = p.attr("data-anitime"); var anilength = p.attr("data-anilength"); var iteration_count = p.attr("data-ani_iteration_count"); if (anitime && anitime > 0) { jquery($this).css("animation-duration", anitime + "s"); jquery($this).css("-webkit-animation-duration", anitime + "s"); } jquery($this).removeclass("anlength1 anlength2"); if (anilength && anilength != 0) { jquery($this).addclass(anilength); } if (iteration_count == "-1") { jquery($this).css("animation-iteration-count", "infinite"); } else if (iteration_count > 0) { jquery($this).css("animation-iteration-count", iteration_count); } if (delay) { //出现这里需要 settimeout(function () { jquery($this).addclass('qsa'); }, delay * 1000); } else { if (jquery($this).hasclass("delay1")) { settimeout(function () { jquery($this).addclass('qsa'); }, 1000); } else if (jquery($this).hasclass("delay0.5")) { settimeout(function () { jquery($this).addclass('qsa'); }, 500); } else if (jquery($this).hasclass("delay1.5")) { settimeout(function () { jquery($this).addclass('qsa'); }, 1500); } else if (jquery($this).hasclass("delay2")) { settimeout(function () { jquery($this).addclass('qsa'); }, 2000); } else if (jquery($this).hasclass("delay3")) { settimeout(function () { jquery($this).addclass('qsa'); }, 3000); } else if (jquery($this).hasclass("delay4")) { settimeout(function () { jquery($this).addclass('qsa'); }, 4000); } else if (jquery($this).hasclass("delay5")) { settimeout(function () { jquery($this).addclass('qsa'); }, 5000); } else if (jquery($this).hasclass("delay6")) { settimeout(function () { jquery($this).addclass('qsa'); }, 6000); } else { jquery($this).addclass('qsa'); } } } function qfe_animate_fun_new($this, type) { var p = jquery($this).closest(".qfy-element"); var delay = p.attr("data-anidelay_" + type); var anitime = p.attr("data-anitime_" + type); var anilength = p.attr("data-anilength_" + type); var iteration_count = p.attr("data-ani_iteration_count_" + type); if (anitime && anitime > 0) { jquery($this).css("animation-duration", anitime + "s"); jquery($this).css("-webkit-animation-duration", anitime + "s"); } jquery($this).removeclass("anlength1 anlength2"); if (anilength && anilength != 0) { jquery($this).addclass(anilength); } if (delay) { jquery($this).css("animation-delay", delay + "s"); jquery($this).css("-webkit-animation-delay", delay + "s"); } if (iteration_count == "-1") { jquery($this).css("animation-iteration-count", "infinite"); } else if (iteration_count > 0) { jquery($this).css("animation-iteration-count", iteration_count); } } var qfy_animateevent_start = function () { var el = document.createelement('div'); var map = { animation: 'animationstart', mozanimation: 'animationstart', webkitanimation: 'webkitanimationstart' }; for (var name in map) { if (el.style[name] !== undefined) { return map[name]; } } }(); var qfy_animateevent_end = function () { var el = document.createelement('div'); var map = { animation: 'animationend', mozanimation: 'animationend', webkitanimation: 'webkitanimationend' }; for (var name in map) { if (el.style[name] !== undefined) { return map[name]; } } }(); function qfy_animate_out($this) { var outs = new array("qfe_ttbout", "qfe_ttbout-1", "qfe_ttbout-2", "qfe_bttout", "qfe_bttout-1", "qfe_bttout-2", "qfe_ltrout", "qfe_ltrout-1", "qfe_ltrout-2", "qfe_rtlout", "qfe_rtlout-1", "qfe_rtlout-2", "slideoutdown", "slideoutleft", "slideoutright", "popout", "popoutup", "popoutdown", "popoutleft", "popoutright", "fadeout", "fadeoutup", "fadeoutdown", "fadeoutleft", "fadeoutright", "zoomout", "zoomoutup", "zoomoutdown", "zoomoutleft", "zoomoutright", "flipoutx", "flipouty", "hinge", "rotateout"); jquery($this)[0].addeventlistener(qfy_animateevent_end, function (e) { if (jquery.inarray(e.animationname, outs) > -1) { jquery($this).addclass("anihide"); } }, false); } function vc_waypoints() { if (typeof resetsectionheight !== 'undefined') resetsectionheight(); if (typeof jquery.fn.waypoint !== 'undefined') { jquery('.qfe_animate_when_almost_visible:not(.qsa)').waypoint(function () { if (jquery(this).hasclass("qfe_tohide")) { if (!is_edit_model) { jquery(this).closest(".qfy-element").addclass("anihide"); } jquery(this).addclass('qsa'); } else { qfe_animate_fun(this); if (!is_edit_model) { qfy_animate_out(this); } } }, {offset: '85%'}); } jquery("[data-ani_c]").each(function () { var to = jquery(this).attr("data-ani_c_element"); var c_fun = function ($this) { if (jquery($this).attr("data-ani_c") == "tohide") { if (!is_edit_model) { jquery($this).addclass("anihide"); } return; } jquery($this).addclass("qfe_" + jquery($this).attr("data-ani_c") + "_c"); qfe_animate_fun_new($this, "c"); jquery($this).removeclass('qsa qsa_c qsa_h qsa_l'); settimeout(function () { jquery($this).addclass("qsa_c").removeclass("anihide"); }, 30); }; var $this = this; if (to) { if (jquery($this).parent().hasclass("bitwidgetframe")) { jquery('#' + to).click(function () { c_fun($this); }); } else { jquery('[qfyuuid="' + to + '"]').click(function () { c_fun($this); }); } } else { jquery(this).click(function () { c_fun($this); }); } if (!is_edit_model) { qfy_animate_out($this); } }); jquery("[data-ani_h]").each(function () { var to = jquery(this).attr("data-ani_h_element"); var h_fun = function ($this) { if (jquery($this).attr("data-ani_h") == "tohide") { if (!is_edit_model) { jquery($this).addclass("anihide"); } return; } jquery($this).addclass("qfe_" + jquery($this).attr("data-ani_h") + "_h"); qfe_animate_fun_new($this, "h"); jquery($this).removeclass('qsa qsa_c qsa_h qsa_l'); settimeout(function () { jquery($this).addclass("qsa_h").removeclass("anihide"); }, 30); }; var $this = this; if (to) { if (jquery($this).parent().hasclass("bitwidgetframe")) { jquery('#' + to).mouseenter(function () { h_fun($this); }); } else { jquery('[qfyuuid="' + to + '"]').mouseenter(function () { h_fun($this); }); } } else { jquery(this).mouseenter(function () { h_fun($this); }); } if (!is_edit_model) { qfy_animate_out($this); } }); jquery("[data-ani_l]").each(function () { var to = jquery(this).attr("data-ani_l_element"); var h_fun = function ($this) { if (jquery($this).attr("data-ani_l") == "tohide") { if (!is_edit_model) { jquery($this).addclass("anihide"); } return; } jquery($this).addclass("qfe_" + jquery($this).attr("data-ani_l") + "_l"); qfe_animate_fun_new($this, "l"); jquery($this).removeclass('qsa qsa_c qsa_h qsa_l'); settimeout(function () { jquery($this).addclass("qsa_l").removeclass("anihide"); }, 30); }; var $this = this; if (to) { if (jquery($this).parent().hasclass("bitwidgetframe")) { jquery('#' + to).mouseleave(function () { h_fun($this); }); } else { jquery('[qfyuuid="' + to + '"]').mouseleave(function (e) { h_fun($this); }); } } else { jquery(this).mouseleave(function (e) { h_fun($this); }); } if (!is_edit_model) { qfy_animate_out($this); } }); } } /* * teaser grid: isotope * ---------------------------------------------------------- */ if (typeof window['vc_teasergrid'] !== 'function') { function vc_teasergrid() { var layout_modes = { fitrows: 'fitrows', masonry: 'masonry' } if (jquery(".list-style9").length > 0) { jquery(".list-style9").each(function () { vc_isotope_init_load(jquery(this).find(".vc-carousel-slideline-inner")); }) } if (jquery("body.compose-mode").length == 1) { jquery(".vc-element .vc_ca_post_id a:not(.cate)").each(function () { if (!jquery(this).hasclass("thickbox")) { var href = jquery(this).attr("href"); jquery(this).removeattr("href"); var p = jquery(this).closest(".vc_ca_post_id"); jquery(this).unbind("click").bind("click", function () { top.menuredirect(href, p); return false; }) } }) if (top.jquery && !top.jquery("body").hasclass("caterole")) { jquery(".content-wrapper .vc-element .vc_ca_post_id").mouseenter(function () { jquery(this).css("outline", "2px dotted #5e87b0"); if (jquery(this).find(".vc_list_edit_button").length == 0) { if (jquery(this).find(".blog-media .toeditor,#item_block .toeditor").length == 0) { jquery(this).find(".blog-media,#item_block").append("复制打开"); } if (jquery(this).closest(".vc-element").attr("data-model-id")) { var editname = "更换图片"; if (jquery(this).closest(".qfy-element").attr("data-post") == "attachment") { editname = "编辑"; } jquery(this).find(".blog-media").append("" + editname + "设置"); jquery(this).find(".item_img").append("" + editname + "设置"); var p = jquery(this); if (p.find(".post-title").length > 0 && p.find(".post-title .vc_list_edit_action").length == 0) { var actionstr = ''; var title = p.find(".post-title"); if (p.find(".post-title >a").length > 0) { var title = jquery(this).find(".post-title >a"); if (title.html() && title.html().length > 15) { var newtitle = title.html().substr(0, title.html().length - 6); title.html("" + newtitle + "") } p.find(".post-title >a:first").append(actionstr); } else { var title = jquery(this).find(".post-title >span:first"); if (title.html() && title.html().length > 15) { var newtitle = title.html().substr(0, title.html().length - 6); title.html("" + newtitle + "") } p.find(".post-title >span:first").append(actionstr); } } if (p.find(".post_excerpt").length > 0 && p.find(".post_excerpt .vc_list_edit_action").length == 0) { var actionstr = ''; if (p.find(".post_excerpt >p").length > 0) { p.find(".post_excerpt >p").append(actionstr); } else { p.find(".post_excerpt").append(actionstr); } } if (jquery(this).find(".title").length > 0 && jquery(this).find(".title .vc_list_edit_action").length == 0) { var actionstr = ''; jquery(this).find(".title").append(actionstr); } if (jquery(this).find(".details").length > 0 && jquery(this).find(".details .vc_list_edit_action").length == 0) { var actionstr = ''; jquery(this).find(".details").append(actionstr); } if (jquery(this).find(".subtitle").length > 0 && jquery(this).find(".subtitle .vc_list_edit_action").length == 0) { var actionstr = ''; jquery(this).find(".subtitle").append(actionstr); } if (jquery(this).find(".post_date").length > 0 && jquery(this).find(".post_date .vc_list_edit_action").length == 0) { var actionstr = ''; jquery(this).find(".post_date").append(actionstr); } if (jquery(this).find(".price_warp").length > 0 && jquery(this).find(".price_warp .vc_list_edit_action").length == 0) { var current_pid = jquery(this).attr("data-postid"); var actionstr = ''; jquery(this).find(".price_warp").append(actionstr); } } } }).mouseleave(function () { jquery(this).css("outline", "0").find(".vc_list_edit_action").remove(); jquery(this).find(".blog-media,#item_block").find(".toeditor").remove(); jquery(this).find(".edittitle").remove(); jquery(this).find(".hidetitle").each(function () { var t = jquery(this).html(); jquery(this).parent().html(t); }) }); if (jquery(".product-content.single-product").length == 0) { jquery(".bitcommerce-main-image,.wd_product_wrapper .product_a").mouseenter(function () { jquery(this).removeattr("href").append("数据页面"); }).mouseleave(function () { jquery(this).find(".toeditor").remove(); }); } } jquery('.content-wrapper .qfy-listcatecontrols li').each(function () { var $li = jquery(this); $li.mouseenter(function () { jquery(this).css("outline", "1px dotted #5e87b0"); if (jquery(this).find(".toeditor").length == 0) { jquery(this).append(""); } }).mouseleave(function () { jquery(this).css("outline", "0"); jquery(this).find(".toeditor").remove(); }); }); } jquery('.qfe_grid .teaser_grid_container:not(.qfe_carousel), .qfe_filtered_grid .teaser_grid_container:not(.qfe_carousel)').each(function () { var $container = jquery(this); var $thumbs = $container.find('.qfe_thumbnails'); var layout_mode = $thumbs.attr('data-layout-mode'); // .. if (jquery("body.compose-mode").length == 1) { var p = $container.closest(".qfy-element"); var iscontent = $container.closest(".content-wrapper"); // && $thumbs.closest(".vc-element").length>0 if (self!=top && typeof top.jquery=="function" && !top.jquery("body").hasclass("caterole")) { $thumbs.find(".isotope-item").mouseenter(function () { if (iscontent.length == 0) return; jquery(this).css("outline", "2px dotted #5e87b0"); if (jquery(this).find(".vc_list_edit_button").length == 0) { var editor_html = "设置复制打开" jquery(this).append(editor_html); // 编辑 if ($container.closest(".vc-element").attr("data-model-id")) { jquery(this).find(".post-thumb").css("position", "relative"); var editname = "更换图片"; if (jquery(this).closest(".qfy-element").attr("data-post") == "attachment") { editname = "编辑"; } jquery(this).find(".post-thumb").append("" + editname + "设置"); if (jquery(this).find(".post-title").length > 0 && jquery(this).find(".post-title .vc_list_edit_action").length == 0) { var actionstr = ''; if (jquery(this).find(".post-title >a").length > 0) { var title = jquery(this).find(".post-title >a"); if (title.html() && title.html().length > 15) { var newtitle = title.html().substr(0, title.html().length - 6); title.html("" + newtitle + "") } jquery(this).find(".post-title >a:first").append(actionstr); } else { var title = jquery(this).find(".post-title >span:first"); if (title.html() && title.html().length > 15) { var newtitle = title.html().substr(0, title.html().length - 6); title.html("" + newtitle + "") } jquery(this).find(".post-title >span:first").append(actionstr); } if (jquery(this).find(".post-title i.glyphicon").length > 0) { jquery(this).find(".post-title i.glyphicon").append(''); } } if (jquery(this).find(".post_excerpt").length > 0) { var actionstr = ''; if (jquery(this).find(".post_excerpt >p").length > 0 && jquery(this).find(".post_excerpt .vc_list_edit_action").length == 0) { jquery(this).find(".post_excerpt >p").append(actionstr); } else { jquery(this).find(".post_excerpt").append(actionstr); } } if (jquery(this).find(".subtitle").length > 0 && jquery(this).find(".subtitle .vc_list_edit_action").length == 0) { var actionstr = ''; jquery(this).find(".subtitle").append(actionstr); } if (jquery(this).find(".price_warp").length > 0 && jquery(this).find(".price_warp .vc_list_edit_action").length == 0) { var current_pid = jquery(this).attr("data-postid"); var actionstr = ''; jquery(this).find(".price_warp").append(actionstr); } if (jquery(this).find(".post-comment").length > 0 && jquery(this).find(".post-comment .vc_list_edit_action").length == 0) { jquery(this).find(".post-comment").append(''); } if (jquery(this).find(".vc_read_more").length > 0 && jquery(this).find(".vc_read_more .vc_list_edit_action").length == 0) { jquery(this).find(".vc_read_more").append(''); } } } }).mouseleave(function () { jquery(this).css("outline", "0"); jquery(this).find(".toeditor,.vc_list_edit_action").remove(); jquery(this).find(".edittitle").remove(); jquery(this).find(".hidetitle").each(function () { var t = jquery(this).html(); jquery(this).parent().html(t); }) }); if (p.find(".mypages").length > 0) { p.find(".mypages").mouseenter(function () { if (p.find(".mypages .vc_list_edit_action").length == 0) { p.find(".mypages").append(''); } }).mouseleave(function () { p.find(".vc_list_edit_action").remove(); }); } } $thumbs.find("a:not(.cate)").each(function () { if (!jquery(this).hasclass("thickbox")) { var href = jquery(this).attr("href"); jquery(this).removeattr("href"); var p = jquery(this).closest(".isotope-item"); jquery(this).unbind("click").bind("click", function () { top.menuredirect(href, p); return false; }) } }) } $container.find('.categories_filter a:not(.link)').data('isotope', $thumbs).click(function (e) { e.preventdefault(); var $thumbs = jquery(this).data('isotope'); jquery(this).parent().parent().find('.active').removeclass('active'); jquery(this).parent().addclass('active'); if (!$container.hasclass("noanimale")) { $thumbs.isotope({ filter: jquery(this).attr('data-filter'), itemselector: '.isotope-item', layoutmode: 'fitrows' }); } else { var filter = jquery(this).data('filter'); if (filter == "*") { $thumbs.find(">li").show(); } else { $thumbs.find(">li").hide(); $thumbs.find(filter).show(); } } }); if (!jquery(this).hasclass("noanimale")) { vc_isotope_init_load($thumbs); } }); } } function vc_isotope_init_load(obj) { if (obj.find('.post-thumb img,.item_img img').length == 0) { obj.isotope({ filter: '*', itemselector: '.isotope-item', layoutmode: obj.attr("data-layout-mode") ? obj.attr("data-layout-mode") : 'fitrows' }); obj.parent().find(".isotope_loading").remove(); return; } var all_load = true; obj.find('.post-thumb img,.post-thumb video,.item_img img').each(function () { if (!jquery(this).prop('complete')) { all_load = false; } }); if (!all_load) { window.settimeout(function () { vc_isotope_init_load(obj); }, 500); return; } obj.isotope({ filter: '*', itemselector: '.isotope-item', layoutmode: obj.attr("data-layout-mode") ? obj.attr("data-layout-mode") : 'fitrows' },function(){ obj.parent().find(".isotope_loading").remove(); }); } if (typeof window['vc_carouselbehaviour'] !== 'function') { function vc_carouselbehaviour() { jquery(".qfe_carousel").each(function () { var $this = jquery(this); if ($this.data('carousel_enabled') !== true && $this.is(':visible')) { $this.data('carousel_enabled', true); var carousel_width = jquery(this).width(), visible_count = getcolumnscount(jquery(this)), carousel_speed = 500; if (jquery(this).hasclass('columns_count_1')) { carousel_speed = 900; } var carousele_li = jquery(this).find('.qfe_thumbnails-fluid li'); carousele_li.css({"margin-right": carousele_li.css("margin-left"), "margin-left": 0}); jquery(this).find('.qfe_wrapper:eq(0)').jcarousellite({ btnnext: jquery(this).find('.next'), btnprev: jquery(this).find('.prev'), visible: visible_count, speed: carousel_speed }) .width('100%');// carousel_width var fluid_ul = jquery(this).find('ul.qfe_thumbnails-fluid'); fluid_ul.width(fluid_ul.width() + 300); jquery(window).resize(function () { var before_resize = screen_size; screen_size = getsizename(); if (before_resize != screen_size) { window.settimeout('location.reload()', 20); } }); } }); } } if (typeof window['vc_slidersbehaviour'] !== 'function') { function vc_slidersbehaviour() { // var sliders_count = 0; jquery('.qfe_gallery_slides').each(function (index) { var this_element = jquery(this); var ss_count = 0; if (this_element.hasclass('qfe_slider_nivo')) { var sliderspeed = 800, slidertimeout = this_element.attr('data-interval') * 1000; if (slidertimeout == 0) slidertimeout = 9999999999; this_element.find('.nivoslider').nivoslider({ effect: 'boxraingrow,boxrain,boxrainreverse,boxraingrowreverse', // specify // sets // like: // 'fold,fade,slicedown' slices: 15, // for slice animations boxcols: 8, // for box animations boxrows: 4, // for box animations animspeed: sliderspeed, // slide transition speed pausetime: slidertimeout, // how long each slide will show startslide: 0, // set starting slide (0 index) directionnav: true, // next & prev navigation directionnavhide: true, // only show on hover controlnav: true, // 1,2,3... navigation keyboardnav: false, // use left & right arrows pauseonhover: true, // stop animation while hovering manualadvance: false, // force manual transitions prevtext: 'prev', // prev directionnav text nexttext: 'next' // next directionnav text }); } else if (this_element.hasclass('qfe_image_grid')) { var isotope = this_element.find('.qfe_image_grid_ul'); isotope.isotope({ // options itemselector: '.isotope-item', layoutmode: 'fitrows' }); jquery(window).load(function () { isotope.isotope("relayout"); }); } }); } } function getcolumnscount(el) { var find = false, i = 1; while (find == false) { if (el.hasclass('columns_count_' + i)) { find = true; return i; } i++; } } var screen_size = getsizename(); function getsizename() { var screen_size = '', screen_w = jquery(window).width(); if (screen_w > 1170) { screen_size = "desktop_wide"; } else if (screen_w > 960 && screen_w < 1169) { screen_size = "desktop"; } else if (screen_w > 768 && screen_w < 959) { screen_size = "tablet"; } else if (screen_w > 300 && screen_w < 767) { screen_size = "mobile"; } else if (screen_w < 300) { screen_size = "mobile_portrait"; } return screen_size; } function loadscript(url, $obj, callback) { var script = document.createelement("script") script.type = "text/javascript"; if (script.readystate) { // ie script.onreadystatechange = function () { if (script.readystate == "loaded" || script.readystate == "complete") { script.onreadystatechange = null; callback(); } }; } else { } script.src = url; $obj.get(0).appendchild(script); } function qfe_prepare_tab_content(event, ui) { var panel = ui.panel || ui.newpanel; vc_carouselbehaviour(); var $ui_panel = jquery(panel).find('.isotope'), $google_maps = jquery(panel).find('.qfe_gmaps_widget'); if ($ui_panel.length > 0) { $ui_panel.isotope("relayout"); } if ($google_maps.length && !$google_maps.is('.map_ready')) { var $frame = $google_maps.find('iframe'); $frame.attr('src', $frame.attr('src')); $google_maps.addclass('map_ready'); } } jquery(window).resize(function () { bitresizeimagetextinit(); }); jquery(window).ready(function () { settimeout(function () { bitresizeimagetextinit(); }, 300); }); function bitresizeimagetextinit() { jquery(".bitimagecontroldiv .bit-tp-caption.wf-mobile-hidden").each(function () { var dataorgipara = jquery(this).attr("dataorgipara"); if (dataorgipara) { var $this = this; var p = jquery(this).parent().parent(); var img = p.find(".bitimageparentdiv img"); if (img.length > 0) { var imgw = img.width(); var imgh = img.height(); } else { var imgw = p.find(".bitimageparentdiv .banner-img").width(); var imgh = p.find(".bitimageparentdiv .banner-img").height(); } var download = new image(); download.src = img.attr("src"); if (imgw > 760) { inittextposition(dataorgipara, imgw, imgh, this); } else { /* * download.onload = function () { * inittextposition(dataorgipara,imgw,imgh,$this); } * download.onerror = function (err, msg) { * inittextposition(dataorgipara,imgw,imgh,$this); } */ } } }) } function inittextposition(dataorgipara, imgw, imgh, obj) { dataorgipara = dataorgipara.split("\|"); var textorgleft = dataorgipara[0]; var textorgtop = dataorgipara[1]; var width = dataorgipara[2]; var s = dataorgipara[3]; var textorgright = dataorgipara[4]; var textorgbottom = dataorgipara[5]; if (imgw != width && imgw > 0) { var n = (width / imgw).tofixed(4); // if(s/n<10){n=s/10;} jquery(obj).css("font-size", s / n).css("line-height", "auto").css("min-height", "0").css("min-width", "0"); jquery(obj).find("slidetext").css("line-height", "auto"); var textw = jquery(obj).width(); var texth = jquery(obj).height(); var paddingleft = jquery(obj).css("padding-left"); if (paddingleft && paddingleft.indexof("px")) { paddingleft = paddingleft.replace("px", "") } ; var paddingtop = jquery(obj).css("padding-top"); if (paddingtop && paddingtop.indexof("px")) { paddingtop = paddingtop.replace("px", "") } ; var s = jquery(obj).css("left"); if (textorgleft != 0) { if (s.indexof("px") > -1) { s = s.replace("px", ""); jquery(obj).css("left", textorgleft * imgw - textw / 2 - paddingleft); } } if (textorgright == 1) { jquery(obj).css("right", "0").css("left", "auto"); } var s = jquery(obj).css("top"); if (textorgtop != 0) { if (s.indexof("px") > -1) { s = s.replace("px", ""); jquery(obj).css("top", textorgtop * imgh - texth / 2 - paddingtop); } } if (textorgbottom == 1) { jquery(obj).css("bottom", "0").css("top", "auto"); } } else { var css = jquery(obj).attr("style"); if (css) { css = css.replace(/font-size[^p]*px;/, ""); css = css.replace(/right: 0px/, ""); css = css.replace(/bottom: 0px/, ""); css = css.replace(/line-height[^;]*;/, ""); jquery(obj).attr("style", css); var left = jquery(obj).attr("dataleft"); jquery(obj).css("left", left + "px"); var top = jquery(obj).attr("datatop"); jquery(obj).css("top", top + "px"); } } jquery(obj).addclass("on").show(); }