$(function () {
$('#fullpage').fullpage({
scrolloverflow: true,
responsivewidth: 800,
// autoscrolling:false
scrolloverflowoptions: {
scrolly: true
},
// setautoscrolling: true,
fixedelements: '#index_nav',
anchors: ['slogan', 'introduct', 'brand', 'solution', 'honor', 'partner'],
// anchors: ['slogan', 'introduct', 'brand', 'honor', 'partner'],
afterload: function(origin, destination, direction){
// console.log(destination);
if(destination.anchor == 'brand'){
$('.brand').addclass('brand-active');
}else{
$('.brand').removeclass('brand-active');
}
if(destination.anchor == 'solution'){
$('.solution-product').addclass('solution-product-active');
}else{
$('.solution-product').removeclass('solution-product-active');
}
if(destination.anchor == 'honor'){
$('.honor-list').addclass('honor-list-active');
}else{
$('.honor-list').removeclass('honor-list-active');
}
if(destination.index > 0){
$(".layui-fixbar .layui-fixbar-top").show();
}else{
$(".layui-fixbar .layui-fixbar-top").css('display','none');
}
}
});
layui.use('util', function(){
var util = layui.util;
//执行
util.fixbar({
bar1: false,
bar2: false,
showheight: 0,
click: function(type){
if(type == 'top'){
$.fn.fullpage.moveto('slogan');
}
}
});
});
$('.introduct-more').click(function(){
$.fn.fullpage.moveto('brand');
})
$('.brand').click(function(){
window.open('http://www.t-firefly.com', '_blank');
});
// $('.solution-desc').click(function(){
// window.open('http://www.nagrace.com', '_blank');
// });
$('.cooperation-form .type').click(function () {
$('.cooperation-form .type').removeclass('type-checked');
$('.cooperation-form .type').addclass('type-nochecked');
$(this).addclass('type-checked').removeclass('type-nochecked');
})
$('.honor-list li').click(function(){
// console.log(123);
var img = $(this).find('img').data('pic');
var honor_name = $(this).find('span').html();
var openhtml = '
'+honor_name+'
';
layer.open({
type: 1,
title: false,
closebtn: 0,
area: ['400px', '358px'],
skin: 'layui-layer-honor', //自定义css
shadeclose: true,
content: openhtml
});
// $('.layui-layer-honor').css('top', '100px');
})
$('.video').click(function(){
var img = $(this).find('img').data('pic');
var honor_name = $(this).find('span').html();
var openhtml = '';
layer.open({
type: 3,
title: false,
closebtn: 0,
area: ['732px', '410px'],
// skin: 'layui-layer-honor', //自定义css
shadeclose: true,
content: openhtml
});
})
$('.cooperation-form form').bootstrapvalidator({
// message: 'this value is not valid',
feedbackicons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
user_name: {
// message: 'the username is not valid',
validators: {
notempty: {
// message: 'the username is required and cannot be empty'
},
// stringlength: {
// min: 6,
// max: 30,
// message: 'the username must be more than 6 and less than 30 characters long'
// },
// regexp: {
// regexp: /^[a-za-z0-9_]+$/,
// message: 'the username can only consist of alphabetical, number and underscore'
// }
}
},
user_email: {
validators: {
notempty: {
// message: 'the email is required and cannot be empty'
},
emailaddress: {
// message: 'the input is not a valid email address'
}
}
},
user_phone: {
validators: {
notempty: {
// message: 'the email is required and cannot be empty'
},
// phone: {
// message: 'the input is not a valid email address'
// }
}
},
user_company: {
validators: {
notempty: {
// message: 'the email is required and cannot be empty'
},
// phone: {
// message: 'the input is not a valid email address'
// }
}
},
detail_info: {
// message: 'the username is not valid',
validators: {
notempty: {
// message: 'the username is required and cannot be empty'
},
stringlength: {
min: 6,
// max: 30,
// message: 'the username must be more than 6 and less than 30 characters long'
},
// regexp: {
// regexp: /^[a-za-z0-9_]+$/,
// message: 'the username can only consist of alphabetical, number and underscore'
// }
}
},
info_form: {
validators: {
notempty: {},
callback: {
message: '请选择信息来源',
callback: function (value, validator) {
// console.log(value);
// return false;
if (value == 0) {
return false;
} else {
return true;
}
}
}
}
},
// captcha: {
// validators: {
// notempty: {},
// callback: {
// message: '',
// callback: function (value, validator) {
// console.log(value);
// }
// }
// }
// }
}
});
});
$('#video-model').on('hidden.bs.modal', function (e) {
$('#video-intr').trigger('pause');
});