...
|
...
|
@@ -5,7 +5,7 @@ |
|
|
*/
|
|
|
window.tmp$ = null;
|
|
|
var $ = require('jquery');
|
|
|
$(".lazy").lazyload();
|
|
|
require("lazyload");
|
|
|
$.fn.top = function() {
|
|
|
if (arguments.length > 0) {
|
|
|
$(this).css("top", arguments[0]);
|
...
|
...
|
@@ -24,7 +24,6 @@ $.fn.left = function() { |
|
|
}
|
|
|
};
|
|
|
|
|
|
require("lazyload");
|
|
|
var Swiper = require("yoho-idangerous.swiper");
|
|
|
$(".lazy").lazyload();
|
|
|
|
...
|
...
|
@@ -62,12 +61,12 @@ if ($(".swiper-container").find(".swiper-slide").length > 1) { |
|
|
|
|
|
//centerbanner=============================================================================
|
|
|
var bannerSwiper = new Swiper('.swiper-container2', {
|
|
|
pagination: '.pagination-adv',
|
|
|
loop: true,
|
|
|
autoplay: 2000,
|
|
|
autoStopPlay: false,
|
|
|
paginationClickable: true,
|
|
|
onSlideChangeEnd: function() {
|
|
|
pagination : '.pagination-adv',
|
|
|
loop : true,
|
|
|
autoplay : 2000,
|
|
|
autoStopPlay : false,
|
|
|
paginationClickable : true,
|
|
|
onSlideChangeEnd : function() {
|
|
|
bannerSwiper.startAutoplay();
|
|
|
$(".swiper-container2 .lazy").lazyload();
|
|
|
}
|
...
|
...
|
@@ -104,12 +103,14 @@ $(".content").click(function() { |
|
|
|
|
|
//企业滚动效果======================================================================================================
|
|
|
var minMenuHasShow = false;
|
|
|
var minMenuHasDropDown=false;
|
|
|
//小导航是否显示
|
|
|
var isTop = true;
|
|
|
var bigMenuHeight = 220;
|
|
|
//滚动条是否在顶部
|
|
|
$(window).scroll(function() {
|
|
|
var scrollTop = $(this).scrollTop();
|
|
|
if (scrollTop >= 177 && minMenuHasShow === false) {
|
|
|
if (scrollTop >= bigMenuHeight && minMenuHasShow === false) {
|
|
|
$(".search-input-box").trigger("blur");
|
|
|
$("#maxEnterprise").css({
|
|
|
visibility : "hidden"
|
...
|
...
|
@@ -123,11 +124,12 @@ $(window).scroll(function() { |
|
|
"z-index" : 99999
|
|
|
}).show();
|
|
|
minMenuHasShow = true;
|
|
|
$(".enterprise-header-fixed").show();
|
|
|
$(".search-input-box").hide();
|
|
|
$(".home-search-button").hide();
|
|
|
window.isSearching = false;
|
|
|
|
|
|
$(".search-text").width(73);
|
|
|
//$(".search-text").width(73);
|
|
|
$(".search-text").find(".search-text-content").html("Search...");
|
|
|
$(".search-input-box").val("").hide().trigger("blur");
|
|
|
$(".search-area").find(".icons").show();
|
...
|
...
|
@@ -138,13 +140,13 @@ $(window).scroll(function() { |
|
|
$("#maxEnterprise").css({
|
|
|
visibility : "visible"
|
|
|
});
|
|
|
$(".enterprise-header-fixed").hide();
|
|
|
$("#minEnterprise").hide();
|
|
|
$(".search-input-box").hide();
|
|
|
$(".home-search-button").hide();
|
|
|
window.isSearching = false;
|
|
|
minMenuHasShow = false;
|
|
|
//搜索归位
|
|
|
$(".search-text").width(73);
|
|
|
$(".search-text").find(".search-text-content").html("Search...");
|
|
|
$(".search-input-box").val("").hide().trigger("blur");
|
|
|
$(".search-area").find(".icons").show();
|
...
|
...
|
@@ -170,6 +172,24 @@ $(window).scroll(function() { |
|
|
$(".search-suggest").hide();
|
|
|
});
|
|
|
|
|
|
$(document).bind({
|
|
|
mousemove : function(event) {
|
|
|
var scrollTop = $(this).scrollTop();
|
|
|
var mouseY=event.pageY-scrollTop;
|
|
|
if(mouseY<=200&&minMenuHasDropDown===false&&minMenuHasShow===true){
|
|
|
minMenuHasDropDown=true;
|
|
|
|
|
|
$("#minEnterprise").animate({top:37},500);
|
|
|
}
|
|
|
else if(minMenuHasDropDown===true&&minMenuHasShow===true&&mouseY>200)
|
|
|
{
|
|
|
minMenuHasDropDown=false;
|
|
|
$("#minEnterprise").animate({top:0},500);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//===============================================================================================================
|
|
|
if (document.body.scrollTop > 0 && isTop === true) {
|
|
|
$(".return-to-top").animate({
|
...
|
...
|
@@ -190,18 +210,17 @@ if (document.body.scrollTop > 0 && isTop === true) { |
|
|
//回到顶部按钮======================================================================================================
|
|
|
$(".return-to-top").click(function() {
|
|
|
$("html,body").animate({
|
|
|
scrollTop: 0
|
|
|
scrollTop : 0
|
|
|
}, 300, function() {
|
|
|
$(".return-to-top").animate({
|
|
|
"filter": "alpha(opacity=0)",
|
|
|
"-moz-opacity": "0",
|
|
|
opacity: "0"
|
|
|
"filter" : "alpha(opacity=0)",
|
|
|
"-moz-opacity" : "0",
|
|
|
opacity : "0"
|
|
|
}, 200);
|
|
|
});
|
|
|
});
|
|
|
//===============================================================================================================
|
|
|
|
|
|
|
|
|
//子菜单交互========================================================================================================
|
|
|
function createSubMenu(info) {
|
|
|
var data = {};
|
...
|
...
|
@@ -224,71 +243,6 @@ function createSubMenu(info) { |
|
|
|
|
|
//================================================================================================================
|
|
|
|
|
|
//频道页、首页碎片交互=================================================================================================
|
|
|
//mulLine.init();
|
|
|
function dealItems() {
|
|
|
var citems = $(".content-item,.content-item-without-border");
|
|
|
if (!citems.length) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var totalLineNum = 7;
|
|
|
// 7 行
|
|
|
var maxTitleStrNum = 45;
|
|
|
// 15个字
|
|
|
var maxDetailStrNum = 22;
|
|
|
// 22个字
|
|
|
|
|
|
if (document.body.clientWidth < 1190) {
|
|
|
totalLineNum = 6;
|
|
|
// 6 行
|
|
|
maxTitleStrNum = 39;
|
|
|
// 13个字
|
|
|
maxDetailStrNum = 54;
|
|
|
// 18个字
|
|
|
}
|
|
|
|
|
|
var titleLineNum = 0;
|
|
|
var subTitleLineNum = 0;
|
|
|
var detailLineNum = 0;
|
|
|
var detailStr = "";
|
|
|
var self = null;
|
|
|
|
|
|
citems.each(function() {
|
|
|
self = $(this);
|
|
|
|
|
|
// 主标题行数
|
|
|
titleLineNum = 1;
|
|
|
if (maxTitleStrNum < parseInt(self.find(".a-title").attr('len'), 10)) {
|
|
|
titleLineNum = 2;
|
|
|
}
|
|
|
|
|
|
// 副标题行数
|
|
|
subTitleLineNum = 1;
|
|
|
if (maxTitleStrNum < parseInt(self.find(".a-subtitle").attr('len'), 10)) {
|
|
|
subTitleLineNum = 2;
|
|
|
}
|
|
|
|
|
|
// 摘要内容行数
|
|
|
detailLineNum = totalLineNum - titleLineNum - subTitleLineNum;
|
|
|
if ((maxDetailStrNum * detailLineNum) < parseInt(self.find(".a-detail").attr('len'), 10)) {
|
|
|
//self.find(".a-detail").mlellipsis(detailLineNum, "detail");
|
|
|
detailStr = self.find(".a-detail").attr("_title").substring(0, (maxDetailStrNum-1) * detailLineNum / 3) + " ...";
|
|
|
self.find(".a-detail").text(detailStr.replace(/[a-zA-Z]+?\s{1}\.\.\.\B/, " ..."));
|
|
|
} else {
|
|
|
self.find(".content-item-detail").text(self.find(".content-item-detail").attr("_title"));
|
|
|
}
|
|
|
});
|
|
|
citems = null;
|
|
|
}
|
|
|
|
|
|
$(function() {
|
|
|
dealItems();
|
|
|
});
|
|
|
|
|
|
window.currentWidth = document.body.clientWidth;
|
|
|
//================================================================================================================
|
|
|
|
|
|
//=================================================================================================================
|
|
|
/*$(window).bind("resize",function(){
|
|
|
fillDetail();
|
...
|
...
|
@@ -297,10 +251,6 @@ fillDetail(); |
|
|
|
|
|
var isIpad = getBrowType().bIsIpad;
|
|
|
|
|
|
$(function() {
|
|
|
dealItems();
|
|
|
});
|
|
|
|
|
|
window.currentWidth = document.body.clientWidth;
|
|
|
//================================================================================================================
|
|
|
|
...
|
...
|
@@ -343,13 +293,13 @@ if (!isIpad && $(".share").size() > 0) { |
|
|
scrollTop = $(window).scrollTop();
|
|
|
if (shareOffsetTop - scrollTop - navHeight <= 0) {
|
|
|
$(".share").css({
|
|
|
"position": "fixed",
|
|
|
"top": navHeight
|
|
|
"position" : "fixed",
|
|
|
"top" : navHeight
|
|
|
});
|
|
|
} else {
|
|
|
$(".share").css({
|
|
|
"position": "absolute",
|
|
|
"top": shareOffsetTop
|
|
|
"position" : "absolute",
|
|
|
"top" : shareOffsetTop
|
|
|
});
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -368,7 +318,7 @@ window.scrollWindow = function() { |
|
|
}
|
|
|
};
|
|
|
//搜索按钮===========================================================================
|
|
|
var clientWidth=$(window).width();
|
|
|
var clientWidth = $(window).width();
|
|
|
$(".search-input-box").keypress(function(event) {
|
|
|
var keyCode = event.keyCode;
|
|
|
if (keyCode === 13) {
|
...
|
...
|
@@ -383,51 +333,62 @@ $("#search-button").click(function() { |
|
|
return false;
|
|
|
});
|
|
|
|
|
|
var searchWidth=$(".search-text").width();
|
|
|
var searchWidth = $(".search-text").width();
|
|
|
|
|
|
$(document.body).click(function() {
|
|
|
var target = $(".search-text");
|
|
|
target.find(".search-input-box").hide();
|
|
|
target.find(".home-search-button").hide();
|
|
|
target.find(".search-text-content").show();
|
|
|
$(".search-text").click(function() {
|
|
|
return false;
|
|
|
});
|
|
|
$(".search-text").click(function() {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
if(clientWidth<=768){
|
|
|
if (clientWidth <= 768) {
|
|
|
target.parent().removeAttr("style");
|
|
|
target.css({width:"auto"});
|
|
|
}
|
|
|
else{
|
|
|
target.css({
|
|
|
width : "auto"
|
|
|
});
|
|
|
} else {
|
|
|
target.animate({
|
|
|
width : searchWidth
|
|
|
}, 500);
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
$(".search-text").click(function() {
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
|
|
|
$(".search-text").click(function() {
|
|
|
$(this).find(".search-text-content").hide();
|
|
|
$(this).parent().width(131);
|
|
|
$(this).find(".search-input-box").width(80).val("").show();
|
|
|
if(clientWidth<=768){
|
|
|
|
|
|
if (clientWidth <= 768) {
|
|
|
$(this).parent().width(131);
|
|
|
$(this).find(".home-search-button").show();
|
|
|
$(this).find(".search-input-box").width(80).val("").show();
|
|
|
$(this).find(".search-input-box").focus();
|
|
|
$(this).width(120);
|
|
|
}else{
|
|
|
$(this).animate({
|
|
|
} else if (clientWidth >= 924 && clientWidth < 1080) {
|
|
|
$(this).parent().width(198);
|
|
|
$(this).find(".search-input-box").width(150).val("").show();
|
|
|
$(this).animate({
|
|
|
width : 190
|
|
|
}, 500, function() {
|
|
|
$(this).find(".home-search-button").show();
|
|
|
$(this).find(".search-input-box").focus();
|
|
|
});
|
|
|
} else {
|
|
|
$(this).parent().width(218);
|
|
|
$(this).find(".search-input-box").width(150).val("").show();
|
|
|
$(this).animate({
|
|
|
width : 190
|
|
|
}, 500, function() {
|
|
|
$(this).find(".home-search-button").show();
|
|
|
$(this).find(".search-input-box").focus();
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
//=================================================================================
|
...
|
...
|
|