作家
登录

javawscript 三级菜单的实现原理

作者: 来源:www.28hudong.com 2013-03-30 02:31:47 阅读 我要评论

省份: 请选择 山东省 城市: ==请选择==威海市德州市滨州市 区县: ==请选择乡镇==威海文登荣成乳山 省份,城市,区县数据结构:【名称,父类ID,当前ID】 onChange="changelocation2(document.editForm.smalllocation.options[document.editForm.smalllocation.selectedIndex].value)" 根据selectedIndex取得下一级关联菜单的父类ID,复制代码 代码如下:function changelocation(locationid) { document.editForm.smalllocation.length = 0; // document.editForm.dlmc0.length = 0; document.getElementById("dlmc0").length=0; //document.editForm.dlmc0.options[0] = new Option('==请选择==',''); document.getElementById("dlmc0").options[0] = new Option('==请选择==',''); //alert(locationid); var locationid=locationid; var i; document.editForm.smalllocation.options[0] = new Option('==请选择==',''); for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.editForm.smalllocation.options[document.editForm.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]); } } }

  推荐阅读

  WordPress 照片lightbox效果的运用几点

如果你的网站上已经使用了lightbox这类效果,或者下面的几点运用经验你也会觉合适(前提是使用JQuery实现)。 1. 指定哪些条件下运用Lightbox效果 在网站的js文件中添加如下语句: 复制代码 代码如下:$(function()>>>详细阅读


本文标题:javawscript 三级菜单的实现原理

地址:http://www.17bianji.com/kaifa2/JS/28532.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)