Difference between revisions of "Template:Team:TU Eindhoven/Timeline Script"
Line 12: | Line 12: | ||
$(".timeBlock").hover(function(){ showEvent( $(this).attr('id').match(/\d+/) ) },function(){ }); | $(".timeBlock").hover(function(){ showEvent( $(this).attr('id').match(/\d+/) ) },function(){ }); | ||
− | |||
Line 19: | Line 18: | ||
$('<p>' + eventInhoud[idnr-1] + '</p>').appendTo("#event") | $('<p>' + eventInhoud[idnr-1] + '</p>').appendTo("#event") | ||
+ | $('#eventsContainer').css({'margin-left':(idnr*97).toString() + 'px'}); | ||
+ | } | ||
− | |||
}); | }); | ||
</html> | </html> |
Revision as of 18:18, 18 September 2015
$(document).ready(function() { var eventInhoud = ['We','zijn','echt','best','wel','fucked...']; for ( index = 1; index <= 11; index++){ $("
").appendTo("#timeline").css({'float':'left','width':'97px','height':'30px'}); } $(".timeBlock").hover(function(){ showEvent( $(this).attr('id').match(/\d+/) ) },function(){ }); function showEvent(idnr) { // hier komt de tekst voor je event (te zien als je hovert) $('' + eventInhoud[idnr-1] + '
').appendTo("#event") $('#eventsContainer').css({'margin-left':(idnr*97).toString() + 'px'}); } });