13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

* reset function used to set all navigation pane divs back to their<br />

initial state */<br />

function reset(element) {<br />

var elt = document.getElementById('drops');<br />

var elts = elt.getElementsByTagName('div');<br />

var exposed = document.getElementById(element);<br />

for (i=0; i< elts.length; i++) {<br />

// we only want to reset divs that are acting as navigation panes<br />

// and exclude the current one that has been set to "exposed"<br />

if (!/drop-/i.test(elts[i].id) || (exposed == document.getElementById(elts[i].id))) {<br />

continue;<br />

}<br />

thiselt = elts[i];<br />

thiselt.className = thiselt.className.replace(/exposed/g,'')<br />

// set style back to overflow: hidden to remove visual artifacts<br />

// when switching from one tab to another<br />

thiselt.style.overflow = "hidden";<br />

}<br />

}<br />

return;<br />

function changeHeight(elt, dH) {<br />

var thiselt = document.getElementById(elt);<br />

// is this a reveal up or down? if up, the final target height is 0<br />

var targetHeight = (dH < 0) ? 0 : dH;<br />

// the current height of the element<br />

var currHeight = thiselt.offsetHeight;<br />

// the change in height required - to smooth the transition we reveal<br />

// half of the remaining height of the pane with each iteration<br />

var dHeight = Math.ceil((targetHeight - currHeight) / 2);<br />

newHeight = currHeight + dHeight;<br />

// if the difference is less than 1 pixel we'll stop moving,<br />

//clear the interval and set the height to the exact height<br />

// we started with<br />

if (Math.abs(dHeight)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!