?
用户评级?/span>
口碑?976 高于平均:5.00%
人气?517501 高于平均:16.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> 地址:上海市镇宁?00号欣安大厦西?A 邮编?00040 电话?21-62471722/23/24 传真?21-62471725 网址?a href="http://www.icpdas.com.cn" target="_blank" rel="nofollow">http://www.icpdas.com.cn Email:sales_sh@icpdas.com.cn 本网站信息涉及广呡内容!";
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");
//})