/******************************************************************* **--> Intro: For Spark Customize WordPress Themes; **--> Author: lizus.com@gmail.com **--> WebSite: http://lizus.com *******************************************************************/ jQuery.noConflict(); //hide empty jQuery(document).ready(function (){ jQuery('.entry p:empty').hide(); jQuery('.entry div:empty').hide(); jQuery('#pro_hide_content p:empty').hide(); jQuery('.pro_entry p:empty').hide(); jQuery('.firstone p:empty').hide(); jQuery('.close_parent').parent().hide(); }); //set all current menu item jQuery(document).ready(function (){ jQuery('.current-cat').each(function (){ jQuery(this).addClass('current-menu-item'); }); jQuery('.current_page_item').each(function (){ jQuery(this).addClass('current-menu-item'); }); }); //list_item jQuery(document).ready(function (){ jQuery('.list_item:last').addClass('list_item_last'); jQuery('.list_item:odd').addClass('list_item_double'); }); //general_widget_wrap jQuery(document).ready(function (){ jQuery('.general_widget_wrap').each(function (){ jQuery(this).children('li:odd').addClass('widget_double'); jQuery(this).children('li:last').addClass('widget_last'); }) }); //nav submenu slide jQuery(document).ready(function (){ jQuery('.nav').each(function (){ jQuery(this).children('ul').children('li:last').addClass('last'); }); jQuery('.nav li>ul').hide(); jQuery('.nav li').hover(function (){ jQuery(this).addClass('hover'); jQuery(this).children('ul').stop().css({height:'auto',display:'none'}).slideDown('fast',function (){ jQuery(this).css({ overflow:'visible', height:'auto' }); }); },function (){ jQuery(this).removeClass('hover'); jQuery(this).children('ul').stop().slideUp('slow'); }); }); //list item double & last jQuery(document).ready(function (){ jQuery('ul').each(function (){ jQuery(this).children('li:odd').addClass('double'); jQuery(this).children('li:last').addClass('last'); }) jQuery('ol').each(function (){ jQuery(this).children('li:odd').addClass('double'); jQuery(this).children('li:last').addClass('last'); }) }); //multi_widget_wrap function jQuery(document).ready(function (){ jQuery('.multi_widget_wrap').each(function (){ if(jQuery(this).children('.widget').size()==0){ jQuery(this).hide(); return; } var multiH2='

'; jQuery('.widget_title',this).each(function (){ multiH2+=''+jQuery(this).html()+''; }); multiH2+='

'; jQuery(this).prepend(multiH2); jQuery(this).children('.widget').hide(); jQuery(this).children('.widget').children('.widget_title').hide(); jQuery(this).children('.widget:first').show(); jQuery(this).children('.widget_title').children('span:first').addClass('current'); }); jQuery('.multi_widget_wrap .widget_title span:not(".current")').live('click',function (){ var parent=jQuery(this).parent(); var index=parent.children('span').index(jQuery(this)); parent.siblings('.widget').stop(); parent.siblings('.widget').slideUp('fast',reHeight); parent.siblings('.widget:eq('+index+')').slideDown('fast',reHeight); parent.children('span').removeClass('current'); jQuery(this).addClass('current'); }); jQuery('.multi_widget_wrap .widget_title span').live('mouseover',function (){ jQuery(this).addClass('hover'); }); jQuery('.multi_widget_wrap .widget_title span').live('mouseout',function (){ jQuery(this).removeClass('hover'); }); }); //add num to widget list jQuery(document).ready(function (){ jQuery('li','.widget').each(function (){ var p=jQuery(this).parent(); var num=p.children('li').index(jQuery(this)); jQuery(this).addClass('num_'+(num+1)); }); }); //add class to widget content jQuery(document).ready(function (){ jQuery('.widget').each(function (){ jQuery(this).children('div').add(jQuery(this).children('ul')).addClass('widget_content'); }); }); //用于tabs的shortcode产生的内容 jQuery(document).ready(function (){ jQuery('.tabs').each(function (){ var tabs=jQuery(this); var tabH3=jQuery('.tabH3',this); jQuery(this).prepend(''); var ul=jQuery(this).children('.tabUL:first'); tabH3.each(function (){ var index=jQuery('h3').index(jQuery(this)); jQuery(this).attr('id','tabH3_'+index); ul.append('
  • '+jQuery(this).text()+'
  • '); }); jQuery('.tab',this).hide(); jQuery('.tab:first',this).addClass('show_now').show(); jQuery('a',ul).bind('click',function (){ var id=jQuery(this).attr('id'); id=id.substring(2); var targetH3=jQuery('#'+id); if (targetH3.parents('.tab').hasClass('show_now')) return false; jQuery('.tab',tabs).filter('.show_now').slideUp(); jQuery('.tab',tabs).removeClass('show_now'); targetH3.parents('.tab').addClass('show_now').slideDown(); return false; }); }); }); /******************************************************************* **--> Intro: For Spark Customize WordPress Themes; **--> Author: lizus.com@gmail.com **--> WebSite: http://lizus.com *******************************************************************/ jQuery.noConflict(); //Markup external link; jQuery(document).ready(function(){ jQuery("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").addClass("external");//.attr("target","_blank"); }); //font jQuery(document).ready(function (){ jQuery('#nav-primary li.current-menu-item a span').addClass('current'); var aspan=jQuery('#nav-primary li').not('.current-menu-item').children('a').children('span'); aspan.each(function (){ jQuery(this).after(jQuery(this).clone()); jQuery(this).addClass('normal'); jQuery(this).next().addClass('hover'); }); jQuery('#nav-primary a span.normal').each(function (){ var txt=jQuery(this).html(); var font='msyh.ttf'; var fontSize=13; var txtColor='777777'; var bgColor='262525'; var rs=''; //如果文字之间不用空格; rs=spark_font(txt,font,fontSize,txtColor,bgColor); //输出 jQuery(this).html(rs); }); jQuery('#nav-primary a span.hover').each(function (){ var txt=jQuery(this).html(); var font='msyh.ttf'; var fontSize=13; var txtColor='ffffff'; var bgColor='161515'; var rs=''; //如果文字之间不用空格; rs=spark_font(txt,font,fontSize,txtColor,bgColor); //输出 jQuery(this).html(rs); }); jQuery('#nav-primary a span.current').each(function (){ var txt=jQuery(this).html(); var font='msyh.ttf'; var fontSize=13; var txtColor='473107'; var bgColor='9E7F3F'; var rs=''; //如果文字之间不用空格; rs=spark_font(txt,font,fontSize,txtColor,bgColor); //输出 jQuery(this).html(rs); }); jQuery('#nav-primary a').hover(function (){ jQuery(this).children('.normal').hide(); jQuery(this).children('.hover').show(); },function (){ jQuery(this).children('.hover').hide(); jQuery(this).children('.normal').show(); }); }); /* //繁简转换 jQuery(document).ready(function (){ var defaultEncoding = 0; //默认是否繁体,0-简体,1-繁体 var translateDelay = 0; //延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0 var cookieDomain = "http://swarovski-blog.com/"; //Cookie地址, 一定要设定, 通常为你的网址 var msgToTraditionalChinese = "繁体"; //默认切换为繁体时显示的中文字符 var msgToSimplifiedChinese = "简体"; //默认切换为简体时显示的中文字符 var translateButtonId = "translateLink"; //默认互换id translateInitilization(); jQuery('#translateLink').bind('click',function (){ translatePage(); return false; }); }); */ //nav-primary 主导航条上是否有二级菜单; jQuery(document).ready(function (){ jQuery('#nav-primary>ul>li').each(function (){ if (jQuery(this).children('ul').size()>0){ jQuery(this).children('a').addClass('has_more'); } }); }); jQuery(document).ready(function (){ var r_pro=jQuery('#r_pro'); if (r_pro.length<1) return; var r_item=r_pro.children('.r_item'); r_item.filter(':first').addClass('show'); r_pro.append('

    '); var r_tag=jQuery('#r_tag'); r_item.each(function (){ r_tag.append(''+jQuery(this).children('.r_title:first').html()+''); }); var r_span=r_tag.children('span'); r_span.filter(':first').addClass('current'); r_span.bind('click',function (){ var index=r_span.index(jQuery(this)); r_item.removeClass('show'); r_item.eq(index).addClass('show'); r_span.removeClass('current'); jQuery(this).addClass('current'); return false; }); }); jQuery(document).ready(function (){ if (jQuery('#pro_hide_content').length>0){ jQuery('#pro_detail_img').html(jQuery('#detail_img').html()); jQuery('#pro_tab1').html(jQuery('#detail_1').html()); jQuery('#pro_tab2').html(jQuery('#detail_2').html()); jQuery('#pro_tab3').html(jQuery('#detail_3').html()); jQuery('#pro_tab4').html(jQuery('#detail_4').html()); jQuery('#pro_tab5').html(jQuery('#detail_5').html()); } jQuery('.detail_tab').hide(); jQuery('.detail_tab:first').show(); jQuery('#pro_mid_tab a:first').addClass('current'); jQuery('#pro_mid_tab a').bind('click',function (){ var index=jQuery('#pro_mid_tab a').index(jQuery(this)); jQuery('.detail_tab').hide(); jQuery('.detail_tab').eq(index).show(); jQuery('#pro_mid_tab a').removeClass('current'); jQuery(this).addClass('current'); return false; }); }); jQuery(document).ready(function () { var h=jQuery('.home'); if (h.size()>0) { return; } jQuery(window).scroll(function () { var st=window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; if (st>130) { jQuery('#nav-toper').addClass('fixed'); }else{ jQuery('#nav-toper').removeClass('fixed'); } }); }); /******************************************************************* **--> Intro: For Spark Customize WordPress Themes; **--> Author: lizus.com@gmail.com **--> WebSite: http://lizus.com *******************************************************************/ jQuery.noConflict(); //go top jQuery(document).ready(function (){ var t=jQuery('#go_top'); t.fly(); }); //reheight main and sidebar jQuery(document).ready(function(){ //equalHeight(jQuery('#sidebar').add(jQuery('#main'))); equalHeight(jQuery('#home1>#sidebar li').add(jQuery('#home1>#main .post'))); equalHeight(jQuery('#home2 .h_item')); }); //auto scrollTo # jQuery(document).ready(function (){ var t=jQuery('a[href*="#"]'); t.each(function (){ var href=jQuery(this).attr('href'); var rs=href.split('#'); if (rs.length>2){ return; } if (rs[0]!='' && rs[0]!=location.href){ return; } jQuery(this).attr('href','#'+rs[1]); }); t.bind('click',function (){ return jQuery(this).scrollTo(); }); });