huaxia/js/huaxia.js

39 lines
2.6 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

$(function(){
$('.logo').on('click',function(){//logo图标点击事件
location.href = 'index.html'
})
$('.dao-box li div').mouseover(function(){//导航悬浮事件
$(this).css("cursor","pointer")
})
$('.dao-box li div').click(function(){//导航点击事件
$('.dao-box li div').removeClass('cq-dao-active')
$('.dao-box li div div').addClass("dn");
$('.dao-box li span').addClass("dn");
$(this).find(".xiahx").removeClass('dn')
$(this).next(".redD").removeClass('dn')
$(this).addClass('cq-dao-active')
})
var html = '';
var data = [
{imgSrc:'img/public/xin-one.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
{imgSrc:'img/public/xin-two.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
{imgSrc:'img/public/xin-three.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
{imgSrc:'img/public/xin-four.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
]
$.each(data, function(commentIndex, comment) {
html +=`<div class="dac backf p-sx20 w48 m-x32">
<img class="fs" src="${comment.imgSrc}" width="242" height="151">
<div class="m-zy15">
<div class="clips1 font-18 col19">${comment.title}</div>
<div class="font-12 col9">${comment.time}</div>
<div class="clips2 font-12">${comment.content}</div>
</div>
</div>`
});
  $('.msg').prepend(html);
let childer = document.querySelectorAll('.ysj .ya-item-box').length
if(childer==5) {
$('.ysj').css({"justify-content":"space-between","marginRight":0})
$('.ysj .ya-item-box').css({"marginRight":0})
}
})