?
用户评级?/span>
口碑?
人气?4547 低于幡均:1.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 href="http://www.hellolink.com.cn/" target="_blank" rel="nofollow">上海积步自动化科技有限公司 地址:上海市嘉定区嘉美路258号A?楼西 邮编?01802 电话?7721204462 传真?21-52849897 网址?a href="http://www.hellolink.com.cn/" target="_blank" rel="nofollow">http://www.hellolink.com.cn/ Email:hello@hellolink.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");
//})