?
用户评级?/span>
口碑?11 高于平均:1.00%
人气?138526 高于平均:3.00%
收藏?
var gory = $("#H_ProductCategoryList").val();
var obj = eval(gory);
$(function () {
$.each(obj, function (key, item) {
if (item.ParentID == "0") {
//如果是一?判断是否有子?
var result = false;
$.each(obj, function (key, itemch) {
if (itemch.ParentID == item.CategoryID) {
result = true;
return;
}
})
if (result == false) {
$("#id_category_" + item.CategoryID).attr("style", "background-image:url('../Content/Foreground/image/zximg/ico_s1.gif')");
$("#id_category_" + item.CategoryID).unbind("click").removeClass("id_HideCateGory").removeClass("id_ShowCateGory");
}
}
})
})
//点击h1事件 展开
$(document).on("click", ".id_ShowCateGory", function () {
var $chi = " 德力西电气有限公?/a> 邮编?25604 电话?57761778888 传真?57761778000 网址?a href="http://www.delixi-electric.com" target="_blank" rel="nofollow">http://www.delixi-electric.com Email:hua.ru@delixi-electric.com 本网站信息涉及广告内容!";
var pid = $(this).attr("data-id");
$.each(obj, function (key, item) {
if (item.ParentID == pid) {
var result = false;
$.each(obj, function (key, itemch) {
if (itemch.ParentID == item.CategoryID) {
result = true;
return;
}
})
if (result == false) {
$chi += "
";
if ($chi != "") {
$(this).parent().append($chi);
}
$(this).attr("style", "background-image:url('../Content/Foreground/image/zximg/ico_s1.gif')");
$(this).unbind("click").addClass("id_HideCateGory").removeClass("id_ShowCateGory");
})
$(document).on("click", ".id_HideCateGory", function () {
$(this).parent().find("ul").remove();
$(this).attr("style", "background-image:url('../Content/Foreground/image/zximg/ico_s2.gif')");
$(this).unbind("click").addClass("id_ShowCateGory").removeClass("id_HideCateGory");
})
//$(".id_HideCateGory").click(function () {
// $(this).parent().remove("li");
// $(this).attr("style", "background-image:url('../Content/Foreground/image/zximg/ico_s2.gif')");
// $(this).unbind("click").addClass("id_ShowCateGory").removeClass("id_HideCateGory");
//})