
你用dom *** 作就可以了,做过dom树的
遍历,在你页面加载完以后,也就是把你的js里的 *** 作函数定义在window.onload上,然后遍历页面已经有的这些
元素,具体怎么遍历看你想深度优先还是广度优先深度优先就
判断每个node的firstChild是不是空,如果不是空就继续取值,如果是空就判断nextSibling的值,广度优先就先判断nextSibling然后再判断下一层,以此类推先建一个类,类中有两个变量作为坐标值public class remtbpoint//remtbpoint类(用来记忆某对象坐标){private inprivate int rpointcolpublic int RPointline{get{return rpointline}set { rpointline = value}}public int RPointcol{get{ return rpointcol}set { rpointcol = value}}}private void rempoint(int line,int col)//记忆子程序,实例化后,赋值,加到arrayList中{r1 =new ;;;r1.RPointLine=liner1.RPointcol=colrembtpointLinst.Add(r1)}private void button1_Click(object sender,EventArgs e)//从记忆的arrayList中取出值,并动态删除最后一个arrayList元素{int x=rembtpointLinst.Count//直接取最末元素if(x=1) {remtbpoint r3 =rembtpointLinst[x-1]asremtbpoint//-------对于取数组列表中某元素太难,用这个方法极好用//do...(r3.RPointLine,r3.RPointcol)这里就可以把arrayList元素对应的坐标值传给其它子程序使用了.
评论列表(0条)