$(function () {
$('.logyul li').each(function(){
var _this=$(this);
_this.attr('data-open','false');
$('.logyul li:first').attr('data-open','true')});
$('.logyul li').bind('click',function(){
$(".open").removeclass("up");
var _this=$(this),_dataopen=_this.attr('data-open');
if(_dataopen=='false'){
_this.addclass('active').siblings().removeclass('active');
_this.find(".open").addclass("up");
$('.logyul li .techno').slideup(500);
$('.logyul li').attr('data-open','false');
$('.techno',_this).slidedown(500);
_this.attr('data-open','true');
}else{
_this.find(".open").removeclass("up");
_this.removeclass('active');
$('.techno',_this).slideup(500);
_this.attr('data-open','false');
}
});
/*ipad适应*/
function orient() {
if(window.screen.width>640){
var viewport = document.queryselector("meta[name=viewport]");//获取meta对象的第一种方法
if (window.orientation == 90 || window.orientation == -90) {
//ipad、iphone竖屏;andriod横屏
$("body").attr("class", "landscape");
orientation = 'landscape';
var phonewidth = parseint(window.screen.width),
phonescale = 1000/1260,
ua = navigator.useragent;
}else if (window.orientation == 0 || window.orientation == 180) {
//ipad、iphone横屏;andriod竖屏
$("body").attr("class", "portrait");
orientation = 'portrait';
var phonewidth = parseint(window.screen.width),
phonescale = 768/1260,
ua = navigator.useragent;
}
viewport.setattribute('content', 'width=1024 maximum-scale ='+phonescale+', minimum-scale='+phonescale+', initial-scale = '+phonescale+'');
}
}
//页面加载时调用
$(function(){
orient();
});
//用户变化屏幕方向时调用
$(window).bind( 'orientationchange', function(e){
orient();
});
/*新闻最终页缩进*/
/*$(".newsinfo p").each(function() {
$(this).find(">img:eq(0)").css({marginleft:"-2em"});
});
$(".newsinfo p").each(function() {
$(this).find("*>img:eq(0)").css({marginleft:"-2.6em"});
});
$(".newsinfo p").filter(function(){return $(this).css("text-align")=="center";}).css({textindent:"0"});
$(".newsinfo p").filter(function(){return $(this).css("text-align")=="center";}).find("img").css({marginleft:"0"});
$(".newsinfo p[align='center']").css({textindent:"0"}).find("img").css({marginleft:"0"}); */
/*手机导航菜单*/
var isfir = 1;
var isfir1 = 1;
$(".menus-mobiles").click(function () {
$(".menus-mobiles").toggleclass("menus-ani1");
if (isfir) {
$(".mobile-menucss:eq(0)").addclass("menu-active");
isfir1 = 1
$(".mobile-menucss:eq(1)").removeclass("menu-hide menu-active");
// $(".menus").addclass("menus-close");
isfir = 0;
} else {
if (isfir == 0) {
$(".mobile-menucss:eq(0)").toggleclass("menu-active");
$(".mobile-menucss:eq(0)").toggleclass("menu-hide");
isfir1 = 1
$(".mobile-menucss:eq(1)").removeclass("menu-hide menu-active");
//$(".menus").toggleclass("menus-close");
}
}
});
/*首页banner切换轮播*/
var swiper = new swiper('.swiper-container-1', {
autoplay: {
delay: 4000,
disableoninteraction: false,
},
slidesperview: 1,
pagination: {
el: '.swiper-container-1 .swiper-pagination',
clickable: true,
},
});
$(".uitabs span").hover(function(){
$(".uitabs span").removeclass("cr");
$(this).addclass("cr");
$(".infos").removeclass("show");
$(".infos:eq("+$(this).index()+")").addclass("show");
});
})
//
//(function(){
// var phonewidth = parseint(window.screen.width),
// phonescale = phonewidth/1200,
// ua = navigator.useragent;
//document.write('');
//
//
// })();
//(function(){
// var phonewidth = parseint(window.screen.width),
// phonescale = phonewidth/1200,
// ua = navigator.useragent;
// if(phonewidth<768)document.write('');
//
// })();