/*==============================================
* js公共库 用于自定义
* copyright 2016 xb, inc. author wanghao
* licensed xiaomingtech
*/
$(document).ready(function(){
/*页面控制*/
;(function($){
//渲染radio
// $('.xb-radio').each(function(){
// $this = $(this);
// var input_hidden = $this.find('input[type=hidden]').eq(0);
// //初始化 radio
// $(this).find('label').on('click',function(){
// $(this).addclass('checked');
// $(this).siblings().removeclass('checked');
// input_hidden.val($(this).attr('data-value'));
// })
// $(this).find('label.checked').click();
// })
//解除浏览器拖拽事件
var $img = $("img");
var moving = function(event){
//something
}
//ie下需要在document的mousemove里面取消默认事件;要用原生js的事件不能用jquery
// document.onmousemove = function(e){
// var ev = e || event;
// ev.cancelbubble=true;
// ev.returnvalue = false;
// }
$img.mousedown(function(event){
//ff下需要在mousedown取消默认操作;
event.preventdefault();
event.stoppropagation();
$(this).bind("mousemove",moving);
})
//图片延迟加载提升性能
$('img.lazy').lazyload({
effect:'fadein'
});
// slider
var fullslide = $('.full-slide');
var effectarr = ['cube','cuberandom','block','cubestop','circles','cubespread','blindwidth','circlesinside','fade','horizontal']
function radom() {
return parseint(math.random()*10)
}
// fullslide.find('img').each(function(e){
// $(this).addclass(effect[radom()]);
// })
fullslide.skitter({
label: false,
numbers: false,
theme: 'minimalist',
show_randomly:true,
navigation:true,
with_animations:effectarr
});
// index focus
jquery(".slidebox").slide({maincell:".bd ul",autoplay:true,effect:"leftloop"});
// looking focus
jquery(".looking-slidebox").slide({maincell:".bd ul",autoplay:true,effect:"leftloop"});
// 客服
var kefufull = $('#xb_kefu_full');
var kefutop = $('#xb_kefu_top');
var kefuinfo = kefufull.find('#xb_kefu_info');//info
// info
kefufull.find('li').hover(function(){
$(this).find('#xb_kefu_info').css('right','105%');
},function(){
$(this).find('#xb_kefu_info').css('right','120%');
});
// top close
$(window).scroll(function() {
var scrolly = $(document).scrolltop();
if (scrolly >600){
kefutop.addclass('xb_kefu_top_css');
// kefuclose.addclass('xb_kefu_close_css');
}else {
kefutop.removeclass('xb_kefu_top_css');
// kefuclose.removeclass('xb_kefu_close_css');
}
});
kefutop.click(function(){
$('html,body').animate({scrolltop:0},'slow');
});
// 返回顶部
$('#topclick').click(function(){
$('html,body').animate({scrolltop:0},'slow');
});
// 城市选择
$('#add-switch').click(function(){
layer.open({
type: 1 //page层类型
,area: ['500px', 'auto']
,title: '选择城市'
,shade: 0.6 //遮罩透明度
,maxmin: false //允许全屏最小化
,anim:0 //0-6的动画形式,-1不开启
,content:$('.add-switch'),
scrollbar: false
// success: function(layero, index){
// layero.find('.send').click(function(){
// layer.close(index);
// })
//}
});
})
// 客户反馈
jquery(".feedback-roll").slide({titcell:".hd ul",maincell:".bd ul",autopage:true,effect:"left",prevcell:".sprev",nextcell:".snext",autoplay:true,vis:4});
// 客户留言
jquery(".feedback-list").slide({titcell:".hd ul",maincell:".bd .ulwrap",autopage:true,effect:"left",autoplay:true,vis:1});
jquery(".focus-gongdi").slide({maincell:"#pic ul",effect:"left", autoplay:false,delaytime:200});
jquery(".brand-list").slide({titcell:".hd ul",maincell:".bd .ulwrap",autopage:true,effect:"leftloop", autoplay:true,vis:2});
jquery(".looking-detail").slide({effect:"left"});
jquery(".threed-model").slide({titcell:".hd ul",maincell:".bd ul",autopage:true,effect:"left",autoplay:true,vis:3,trigger:"click"});
// 缩略切换
jquery(".slide-thumbnail").slide({maincell:"ul",vis:6,prevcell:".sprev",nextcell:".snext",effect:"left",autopage:true,autoplay:true});
// 图像切换
jquery(".casepics").slide({ maincell:".bd ul",effect:"left",autoplay:true});
// 工地切换
/* $('.list-switch').find('li').mouseover(function(){
$(this).addclass('active').siblings().removeclass('active');
}) */
/* $('#gongdi-switch').find('#tabs').tabs("#list-gongdi>ul",{event:'mouseover',tab:'div',tabs:'li',effect: 'default',current:'active',fadeinspeed:600}); */
jquery(".gongdi-progress").slide();
jquery(".progress-atlas").slide({titcell:".hd ul",maincell:".bd ul",autopage:true,effect:"left",prevcell:".sprev",nextcell:".snext",autoplay:true,vis:3});
// 户型图查看
$('.list-layout .list-item').click(function(){
var layimg = $(this).find('.item-media').html();
var laytitle = $(this).find('.item-content a').html();
layer.open({
type: 1,
title:'查看'+laytitle,
closebtn: 1,
area: ['auto', 'auto'],
skin: 'layui-layer-nobg', //没有背景色
shadeclose: true,
content:layimg
});
})
jquery(".designer-album").slide({maincell:".bd ul",effect:"leftloop",prevcell:".daprev",nextcell:".danext",autoplay:true});
// 灵感图库查看
// $('.list-screen .list-item').click(function(){
// var layimg = $(this).find('.item-media').html();
// var laytitle = $(this).find('.item-content a').html();
// layer.open({
// type: 1,
// title:'查看'+laytitle,
// closebtn: 1,
// area: ['auto', 'auto'],
// skin: 'layui-layer-nobg', //没有背景色
// shadeclose: true,
// content:layimg
// });
// })
// 缩略切换
jquery(".designpics-thumbnail").slide({maincell:"ul",vis:7,prevcell:".dpprev",nextcell:".dpnext",effect:"left",autopage:true,autoplay:true});
// 图像切换
jquery(".designpics").slide({ maincell:".bd ul",effect:"left",autoplay:true});
// 栏目切换
jquery(".nav-experience").slide({ maincell:"ul",vis:5,prevcell:".neprev",nextcell:".nenext",effect:"leftloop"});
// 学装修封面页切换
jquery(".study-column").slide();
jquery(".baike-model").slide({titcell:".hd ul",maincell:".bd ul",autopage:true,effect:"left",autoplay:true,vis:3,trigger:"click"});
// 历程
jquery(".list-course").slide({maincell:".bd ul",autopage:true,effect:"left",prevcell:".lcprev",nextcell:".lcnext",autoplay:true,vis:4,trigger:"click"});
var footyuyue = $('#foot-yuyue');
var footyuyueform = $('#foot-yuyue').find('#foot-yuyue-form');
var footyuyueopen = $('#foot-yuyue').find('.openbtn');
var footyuyueclose = $('#foot-yuyue').find('.closebtn');
footyuyueclose.click(function(){
footyuyue.animate({'bottom':'-150px'},function(e){
footyuyueopen.animate({'bottom':'10px'});
footyuyueopen.click(function(e){
footyuyueopen.animate({'bottom':'-110px'});
footyuyue.animate({'bottom':'0px'});
});
})
})
})(jquery)
//end ready
})
/**
* author mr wanghao 2016-06-02
* 滑动跳转构造函数
*/
function ascroll(id,event) {
var h = $('#' + id).offset().top;//- parseint($('.header').css('height'))-60;
$("html, body").stop(true,true).animate({
scrolltop: h + "px"
},
{
duration: 600,
easing: "swing"
});
return false;
}
/**
* 弹出式图集相册基于unitegallery制作2016-06-02
* author mr wanghao
* @id: 分类id
* @element: 事件对象
* @_index:对象索引
* @_url:ajax url
* 数据格式: json:'';
*/
//构造函数
function showgallery(id,element,_index,_url){
//相册画廊
var gallery = '