?
用户评级?/span>
口碑?0
人气?01175
收藏?
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> 邮编?15103 电话?512 66202700 传真?512-66203900 网址?a href="http://www.nodka.com/" target="_blank" rel="nofollow">http://www.nodka.com/ Email:sales@nodka.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");
//})