Javascript: addEventListener

addEventListener registers a single event listener on a single target. The event target may be a single node in a document, the document itself, a window, or an XMLHttpRequest. In IE you have to use attachEvent rather than the standard addEventListener. if (window.addEventListener) { // Mozilla, Netscape, Firefox el.addEventListener(’onclick’, function, false ); } else {
Continue reading Javascript: addEventListener

Javascript: Event defaults

There are a number of cases where you would be interested in stopping the default behavior of an event. The next listing includes code to stop the default link behaviour occuring when links are clicked: addEvent(document.getElementById("stop-default"), "click", stopDefaultBehavior); function stopDefaultBehavior (evt) { var eventReference = (typeof evt !== "undefined")? evt : event; if (eventReference.preventDefault) {
Continue reading Javascript: Event defaults

Highslide JS: JavaScript thumbnail viewer

Highslide JS is an open source JavaScript software, offering a Web 2.0 approach to popup windows. It streamlines the use of thumbnail images and HTML popups on web pages. The library offers these features and advantages: No plugins like Flash or Java required Popup blockers are no problem. The content expands within the active browser
Continue reading Highslide JS: JavaScript thumbnail viewer