From: dseif Date: Thu, 24 Mar 2011 04:56:49 +0000 (-0400) Subject: Adding stuff for clicking div X-Git-Tag: v0.6~14^2~3^2~2^2~5 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=de29b7ecb2c371be14a6ffa5fb9ffed58dcb5d03;p=popcorn-js.git Adding stuff for clicking div --- diff --git a/plugins/timeline/popcorn.timeline.js b/plugins/timeline/popcorn.timeline.js index 53ec5fe..df6ab8a 100644 --- a/plugins/timeline/popcorn.timeline.js +++ b/plugins/timeline/popcorn.timeline.js @@ -25,7 +25,8 @@ * */ - var i = 0; + var i = 0, + that = this; var head = document.getElementsByTagName("head")[0]; var css = document.createElement('link'); @@ -41,7 +42,7 @@ var newdiv = document.createElement( "div" ); newdiv.style.display = "none"; newdiv.id = "asdf"+i; - + if ( document.getElementById( options.target ) ) { document.getElementById( options.target ).appendChild( newdiv ); // if this isnt the first div added to the target div @@ -56,6 +57,14 @@ newdiv.innerHTML = "

" + options.title + "
" + "" + options.text + "
" + "
" + options.links + "

"; + + // adding eventlistener to each div, so when its clicked it will go to divs start time + newdiv.addEventListener( "click", function () { + that.currentTime( options.start ); + }, false ); + + document.links.addEventListener( "click", function () { + }, false ); return { /**