October 2006
Beginner to intermediate
352 pages
9h 33m
English
The first thing to check is to ensure youâre using the DOM Level 2 event handling. If you use DOM Level 0, such as:
window.onload=function;
Youâll overwrite the event handlers the Dojo library has assigned to this specific event.
The $(ââ) function returns whatever element has the identifier passed in as parameter to the function.
Dojo requires these element attributes, but they can be added using JavaScript before Dojo needs them (after the page loads). Create a function to add the attributes, and place a call to this function in the page body just after the toolbar is loaded. In the function, set the attributes using the DOM. Hereâs the code Iâve used for a web page:
function setMenuProps(ââ) { var cont = document.getElementById("controller"); cont.setAttribute("itemWidth","60"); cont.setAttribute("itemHeight","100"); cont.setAttribute("itemMaxWidth", "200"); cont.setAttribute("itemMaxHeight", "300"); cont.setAttribute("orientation","horizontal"); cont.setAttribute("effectUnits","2"); cont.setAttribute("itemPadding","10"); cont.setAttribute("attachEdige","top"); cont.setAttribute("labelEdge","bottom"); cont.setAttribute("enableCrappySvgSupport","false"); var menu1 = document.getElementById("menu1"); menu1.setAttribute("onClick","load_page('http://scriptteaser.com/learningjavascript/')"); menu1.setAttribute("iconsrc","/dotty/dotty.gif"); menu1.setAttribute("caption","Learning JavaScript"); var menu2 = document.getElementById("menu2"); menu2.setAttribute("onClick","load_page('http://scriptteaser.com/threepsandr/')"); ...Read now
Unlock full access