$(function(){
// 自设X
//$(".cusArea:not(:empty):not(:last)").css("margin-bottom", 10);
// list-05,
$(".list-05 .focusPic").slide({titCell:".hd li",mainCell:".bd ul",effect:"fold",interTime:4000,autoPlay:true,effect:"leftLoop"});
$(".list-05 .focusPic").hover(function() {
$(this).find(".prev,.next").stop(1,1).fadeIn(200);
}, function() {
$(this).find(".prev,.next").stop(1,1).fadeOut(200);
});
//list-11
$(".list-11 .focusPic").slide({titCell:".hd li",mainCell:".bd ul",effect:"fold",interTime:4000,autoPlay:true});
// list-09
$(".dropDownInfo").each(function() {
// 判断是否从下方弹出
var top_offset = $(this).find(".bd").height() + $(this).offset().top;
if (top_offset > $("body").height() - 100) {
$(this).find(".bd").addClass("bd-bottom");
}
});
$(".dropDownInfo").hover(function() {
$(this).addClass("dropDowmInfo-active").find(".bd").stop(1,1).slideDown(200);
}, function() {
var _this = $(this);
_this.find(".bd").stop(1,1).slideUp(200, function(){
_this.removeClass("dropDowmInfo-active");
});
});
// list-10 需手动设置vis参数
// $(".list-10 .picScroll").slide({mainCell:".scrollWrap ul",effect:"leftLoop",vis:3});
// list-15
$('.J_loadMore').click(function() {
var $trigger = $(this),
$target = $('#' + $trigger.data('target')),
_nodes = $trigger.data('nodes'),
_bindModel = $trigger.data('bindmodel'),
_outputQty = $trigger.data('outputqty'),
_listOrderType = $trigger.data('listordertype'),
_titleLength = $trigger.data('titlelength'),
_contentLength = $trigger.data('contentlength'),
_imageWidth = $trigger.data('imagewidth'),
_imageHeight = $trigger.data('imageheight'),
_startrow = $target.children().size();
$target.append("
");
$.pe.ajax('accessLabel', {
labelName: 'json信息列表',
params: {
nodes: _nodes,
startrow: _startrow,
outputQty: _outputQty,
bindModel: _bindModel,
listOrderType: 20,
titleLength: _titleLength,
contentLength: _contentLength,
picExist: 'true',
imageWidth: _imageWidth,
imageHeight: _imageHeight
},
success: function(res) {
$target.find(".loading").remove();
res = $(res).find("root");
if (res.find("status").text() == 'ok') {
var i,
list = res.find("body").text(),
total = res.find("total").text();
if (list != "") {
list = JSON.parse(list);
for (i in list) {
$target.append('' + list[i].Intro + '
[详细] ')
}
}
if (_outputQty > total) {
$trigger.addClass("loadAll").unbind("click").html("已获取所有的信息");
console.log(_outputQty, total);
}
}
}
});
});
// list-17
/*
$('.list-17').each(function() {
$(this).find('li ul').css('left', '-9999px').show();
$(this).find('li').hover(function() {
var sub = $(this).find('>ul')
$(this).animate({
'padding-bottom': sub.outerHeight()
}, 200);
sub.stop(1,1).slideDown(200);
}, function() {
var sub = $(this).find('>ul')
$(this).animate({
'padding-bottom': 0
}, 200);
sub.stop(1,1).slideUp(200);
});
$(this).find('li').each(function(n) {
if ($(this).next().length) {
if (n!==0 && $(this).position().top != $(this).next().position().top) {
$(this).after('');
}
}
});
$(this).find('li ul').css('left', '0').hide();
var setLiPadding = function() {
}
});
*/
$('.list-17').each(function() {
var subWrap = $('');
var _module = $(this);
// 用于获取坐标
$(this).find('.ul1').css({
'position': 'absolute',
'left': '-9999px'
}).show();
$(this).find('.li1').each(function(n) {
// 将子菜单添加到一个新元素并通过父元素坐标判断其插入位置
var sub = $(this).find('>ul').attr('data-parent', $(this).attr('id'));
sub.appendTo(subWrap);
if ($(this).next().length) {
if ($(this).position().top != $(this).next().position().top) {
$(this).after(subWrap);
subWrap = $('');
}
} else {
$(this).after(subWrap);
}
});
// 获取坐标后还原
$(this).find('.ul1').css({
'position': 'static',
'left': 'inherit'
}).hide();
var t1;
$(this).find('.li1').hover(function() {
var _this = $(this);
t1 = setTimeout(function() {
$('.ul1[data-parent='+_this.attr('id')+']', _module).show().siblings().hide().parent().show();
_this.addClass('on1').siblings().removeClass('on1');
}, 80);
}, function() {
var _this = $(this);
clearTimeout(t1);
t1 = setTimeout(function() {
$('.ul1[data-parent='+_this.attr('id')+']', _module).show().siblings().hide().parent().hide();
_this.removeClass('on1');
}, 80);
});
var t2;
$(this).find('.subWrap').hover(function() {
clearTimeout(t1);
clearTimeout(t2);
}, function() {
var _this = $(this);
clearTimeout(t2);
t2 = setTimeout(function() {
_this.stop(1,1).hide();
}, 80);
});
$(this).find('.li2').hover(function() {
var _sub = $(this).find('.ul2');
//$(this).css('padding-bottom', _sub.outerHeight()+5).addClass('on2').siblings().removeClass('on2');
$(this).addClass('on2').siblings().removeClass('on2');
_sub.stop(1,1).show();
}, function() {
//$(this).css('padding-bottom', 0).removeClass('on2');
$(this).removeClass('on2');
$(this).find('.ul2').stop(1,1).hide();
});
});
});