var language = getcookie("language");
$(document).ready(function () {
$(".news-list2").css("display", "none");
$(".news .l-news-cont .r-news-txt .news-list ul li").mouseover(function () {
$(this).siblings().removeclass("active");
$(this).addclass("active");
});
$(".news .l-news-cont .r-news-txt .tog span").click(function () {
$(this).siblings().removeclass("act");
$(this).addclass("act");
$(".news-list").css("display", "none");
$(".l-news-img").css("display", "none");
$($(this).data("ref")).css("display", "block");
});
//滚动到了“中梁在中国”区域
document.addeventlistener('scroll', function () {
// 滚动条高度+视窗高度 = 可见区域底部高度
var visiblebottom = window.scrolly + document.documentelement.clientheight;
// 可见区域顶部高度
var visibletop = window.scrolly;
var centery = $(".r-bd")[0].offsettop + $(".r-bd")[0].offsetheight / 2;
if (centery > visibletop && centery < visiblebottom) circirexpand();
})
$(document).on("click", ".news_detail", function () {
setcookie("detail_type", $(this).data("type"));// 1-集团新闻 2-媒体报道 3-社会责任-新闻报道 4-社会责任-媒体报道
setcookie("detail_id", $(this).data("id"));
window.open("media-news-details.html?detail_id="+$(this).data("id")+"&detail_type="+$(this).data("type"), "_self");
})
// 查询轮播图
$.ajax({
type: 'get',
url: './front/idx/drawing',
datatype: 'json',
async: true,
data: {
source : 1
},
success: function (data) {
showdrawing(data);
},
error: function (xmlhttprequest, textstatus, errorthrown) {
console.error("查询轮播图信息失败!");
}
});
// 查询新闻
$.ajax({
type: 'get',
url: './front/media/group_news/getidxnews',
datatype: 'json',
async: true,
data: {
language: language
},
success: function (data) {
shownews(data);
},
error: function (xmlhttprequest, textstatus, errorthrown) {
console.error("查询新闻信息失败!");
}
});
// 查询报道
$.ajax({
type: 'get',
url: './front/media/report/getidxreport',
datatype: 'json',
async: true,
data: {
language: language
},
success: function (data) {
showreport(data);
},
error: function (xmlhttprequest, textstatus, errorthrown) {
console.error("查询报道信息失败!");
}
});
// 查询控股指数
$.ajax({
type: 'get',
url: './front/idx/page_link',
datatype: 'json',
async: true,
data: {
"key": 5
},
success: function (data) {
showkonggu(data);
},
error: function (xmlhttprequest, textstatus, errorthrown) {
console.error("查询信息失败!");
}
});
if (language == 3) {
$(".dc_url").attr("href", "javascript:;");
}
})
/**
* 圆向四周扩散效果
*/
function circirexpand() {
$(".r-bd").find(".y2").animate({
width: "570px",
height: "570px",
left: "-285px",
top: "-285px"
}, 3000);
$(".r-bd").find(".y3").animate({
width: "300px",
height: "300px",
left: "-150px",
top: "-150px"
}, 3000);
$(".r-bd").find(".y4").animate({
width: "160px",
height: "160px",
left: "-80px",
top: "-80px"
}, 3000);
}
//显示控股数值信息
function showkonggu(data) {
if (data != null && null != data.result) {
$("#konggu").html(data.result.val + " ");
}
}
// 显示轮播图信息
function showdrawing(data) {
if (data != null && data.result && data.result.length > 0) {
var box = $("#slides");
$(".drawing").remove();
$("#slides").html("");
for (var i in data.result) {
var li = $("
" + data.result[i].introzhcn + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introzhtw + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introen + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introzhcn + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introzhtw + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introen + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introzhcn + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introzhtw + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introen + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introzhcn + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introzhtw + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "" + data.result[i].introen + "
" + date.getfullyear() + '-' + (date.getmonth() + 1) + '-' + date.getdate() + "