refactor(web):改造成vue工程
This commit is contained in:
49
public/static/home/js/index.js
Normal file
49
public/static/home/js/index.js
Normal file
@@ -0,0 +1,49 @@
|
||||
//banner图切换
|
||||
var banner = new Swiper("#bannerSwiper", {
|
||||
direction: "horizontal",
|
||||
autoplay: 2000,
|
||||
speed: 300,
|
||||
loop: true,
|
||||
pagination: '.pagination',
|
||||
createPagination: false,
|
||||
paginationClickable: true,
|
||||
noSwiping : true,
|
||||
onAutoplayStop: function(banner){
|
||||
if(!banner.support.transitions){ //IE7、IE8
|
||||
banner.startAutoplay();
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".pagination span").hover(function() {
|
||||
$(this).click();
|
||||
},function(){
|
||||
banner.startAutoplay();
|
||||
}
|
||||
);
|
||||
|
||||
//职业简介切换
|
||||
|
||||
//切换男女角色
|
||||
$('.roleTab a').on('mouseenter', function() {
|
||||
if ($(this).hasClass('i-r_w')) {
|
||||
$('#role_swiper .i-r_w').addClass('i-r_w_a').siblings('.i-r_m').removeClass('i-r_m_a');
|
||||
$('#role_swiper .woman').css('display', 'block').siblings('.man').css('display', 'none');
|
||||
} else {
|
||||
$('#role_swiper .i-r_m').addClass('i-r_m_a').siblings('.i-r_w').removeClass('i-r_w_a');
|
||||
$('#role_swiper .man').css('display', 'block').siblings('.woman').css('display', 'none');
|
||||
}
|
||||
});
|
||||
$(".wrapperNav a").click(function(){
|
||||
var _index = $(this).index();
|
||||
$(this).addClass('act').siblings().removeClass('act');
|
||||
$(".roleRlide").hide().eq(_index).show();
|
||||
});
|
||||
|
||||
|
||||
//留言弹窗
|
||||
$('.i-b_message').on('click', function() {
|
||||
$('#mask').show().children('.message_mask').show();
|
||||
});
|
||||
$('#mask .close').on('click', function() {
|
||||
$(this).parent().hide().parent('#mask').hide();
|
||||
});
|
||||
Reference in New Issue
Block a user