$(function(){
$(".socialMediaBox li").each(function(){
var sBoxL=$(".socialMediaBox").find('li').length;
if(sBoxL>16){
$(".socialMediaBox .more").show();
if($(this).index()>14){
$(this).hide();
}
}
});
$(".socialMediaBox .more").click(function(){
if($(this).hasClass('less')){
$(this).removeClass('less');
$(this).find('span').text('展开更多');
$(".socialMediaBox li").each(function(){
if($(this).index()>14){
$(this).hide();
}
});
} else {
$(this).parent().find('li').show();
$(this).addClass('less');
$(this).find('span').text('隐藏更多');
}
});
$(".socialMediaBox li").mousemove(function(e){
$(".code").remove();
$('body').append('
');
$(".code").css({ 'top': codeT,'left': codeL});
var e = event || window.event;
var str = $(this).attr("alt"),
codeL=e.clientX + 10,
codeT=e.clientY - 10;
if ( str!='') {
$(".code").css({ 'top': codeT,'left': codeL});
if (!$.support.leadingWhitespace) {
$(".code").qrcode({ width: 100, height: 100, render:"table",text:str})
}else {
$(".code").qrcode({ width: 100, height: 100, render:"canvas",text:str})
}
}else {
$(".code").css({ 'top': codeT,'left': codeL});
$('.code').append('请下载相关APP
搜索苏州工业园区
添加关注
');
}
});
$(".socialMediaBox li").mouseout(function () {
$(".code").remove();
});
var aLi = $(".n_l_nav span"),
oDiv = $(".n_listBox .cont");
oDiv.width(1600);
aLi.mouseover(function () {
var num = $(this).index(),
ulW = $(this).parent().parent().width();
aLi.stop();
aLi.removeClass("on");
$(this).addClass("on");
$(this).parent().parent().find(".cont").stop().animate({
left: -num * ulW
}, 200)
aLi.stop();
});
var aLi_yw = $(".n_l_nav_yw span"),
oDiv_yw = $(".ywzdBox .cont");
oDiv_yw.width(1800);
aLi_yw.mouseover(function () {
var num_yw = $(this).index(),
ulW_yw = $(this).parent().parent().width();
aLi_yw.stop();
aLi_yw.removeClass("on_ym");
$(this).addClass("on_ym");
$(this).parent().parent().parent().find(".cont").stop().animate({
left: -num_yw * ulW_yw
}, 200)
aLi_yw.stop();
});
var aLi_xx = $(".n_l_nav_xx span"),
oDiv_xx = $(".xxxzBox .cont");
oDiv_xx.width(1800);
aLi_xx.mouseover(function () {
var num_xx = $(this).index(),
ulW_xx = $(this).parent().parent().width();
aLi_xx.stop();
aLi_xx.removeClass("on_xx");
$(this).addClass("on_xx");
$(this).parent().parent().parent().find(".cont").stop().animate({
left: -num_xx * ulW_xx
}, 200)
aLi_xx.stop();
});
// var aLi_yw = $(".n_l_nav_zj span"),
//oDiv_yw = $(".zjbyBox .cont");
// oDiv_yw.width(2400);
// aLi_yw.mouseover(function () {
// var num_yw = $(this).index(),
// ulW_yw = $(this).parent().parent().width();
// aLi_yw.stop();
// aLi_yw.removeClass("on_zj");
// $(this).addClass("on_zj");
// $(this).parent().parent().parent().find(".cont").stop().animate({
// left: -num_yw * ulW_yw
// }, 200)
// aLi_yw.stop();
// });
$('.vListBox .vCont').each(function(){
$(this).width($(this).parent().width())
});
$('.n_imgsBox ul, .imgsBox ul,.vListBox .vCont').responsiveSlides({
speed: 500,
timeout: 3000,
namespace: "callbacks",
pager: true
});
$('.fullImgsBox ul').responsiveSlides({
speed: 500,
timeout: 3000,
namespace: "callbacks",
pager: true,
nav: true,
prevText:"<",
nextText:">",
});
$('.picImgsBox .callbacks_tabs li').each(function(){
var picImgI=$(this).index()+1,
picImg=$(this).parent().parent().find('.callbacks li:nth-child('+picImgI+') img').attr('src');
$(this).find('a').html('');
});
});
$(".scrollBox").each(function(){
var $pic = $(this).find(".list"),
$list = $pic.find("ul"),
linum = $list.find("li").length,
lisize = $list.find("li:first-child").outerWidth(),
picwidth = $pic.width();
$list.width(lisize*linum);
var listwidth=$list.width();
if( picwidth < listwidth){
$pic.find("em.next").addClass('active');
$pic.find("em.next").click(function() {
if ( $(this).hasClass('active')){
listpost = Number($list.css("margin-left").replace("px", ""));
setTimeout(function() {
$list.animate({"margin-left":listpost-lisize},"fast");
$pic.find("em.prev").addClass('active');
});
if (listpost <= (picwidth-listwidth+lisize)){
$(this).removeClass('active');
}
}
});
$pic.find("em.prev").click(function() {
if ( $(this).hasClass('active')){
listpost = Number($list.css("margin-left").replace("px", ""));
$list.animate({"margin-left":listpost+lisize},"fast");
$pic.find("em.next").addClass('active');
if (listpost >= (-lisize)){
$(this).removeClass('active');
}
}
});
}else {
$pic.find('em').removeClass('active');
}
});