Chris Pollett >
Students > [Bio] [Del1] [Del2] [Del3] [Del4] [Firefox Plugin to match h1 tags-ZIP] |
Deliverable 2 -- DOM TestDescription:
The second deliverable was to create a test HTML DOM and capture various mouse events such as mouseover and mouseout.
A test HTML page was created with various block level elements such as <div>, <p> and <table>.
function calculatePath(tgt) { arr = new Array(); //tgt.setCapture(); //alert("int tgt " + tgt); path=tgt.tagName+" "; //alert(path); while(tgt.tagName != 'BODY') { //alert("inside"); arr.push(tgt.tagName); path=path+ tgt.parentNode.tagName +" -- "; tgt = tgt.parentNode; //alert(path); } arr.push('BODY'); //alert(arr); return arr; } function capturePathUp(upNode) { var selection; if(document.selection) { selection = document.selection } else { selection = window.getSelection(); alert(selection.getRangeAt(0)); } //uparr = calculatePath(upNode); //alert("path " + startarr.join(' | ')); /*var lastpop; if(downarr.length > uparr.length) { for(i = downarr.length; i >= uparr.length; i--) { lastpop = downarr.pop(); } } else if(downarr.length < uparr.length){ } else { pickParentBlockElem(uparr); }*/ } |