Mercurial > hg > Members > anatofuz > slideshow-s6cr
view s6/js/jquery.slideshow.footer.js @ 19:24c7aeff6159 default tip
fix overflow use scroll in code block
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 30 Jul 2019 16:27:40 +0900 |
parents | 05d802167c0c |
children |
line wrap: on
line source
/*********** * * footer/header addon: * * adds footer/header * - use key-f to toggle footer/header (in projection mode) * * layout structure: * * .layout * > #header * > #footer */ Slideshow.footerDebugOn = function() { this.debug( 'calling footerDebugOn()' ); $( '.layout #header,.layout header' ).addClass( 'debug' ); $( '.layout #footer,.layout footer' ).addClass( 'debug' ); } Slideshow.footerDebugOff = function() { this.debug( 'calling footerDebugOff()' ); $( '.layout #header,.layout header' ).removeClass( 'debug' ); $( '.layout #footer,.layout footer' ).removeClass( 'debug' ); } Slideshow.footerKeys = function( event, key ) { this.debug( 'calling footerKeys()' ); switch( key.which ) { case 70: //f this.footerToggle(); break; } } // ------------------------------------------------ Slideshow.footerToggle = function() { // todo/fix: note jquery sets inline css (e.g. display: block) // but css won't get scoped for media (e.g. projection, screen, etc) // thus, css changes "spill over" to all media types // fix: add/remove Class hidden?? instead of toggle() $( '.layout #footer, .layout footer').toggle(); } // ------------------------------------------------ Slideshow.footerAddEvents = function() { $( document ).on( 'slideshow.debug.on', $.proxy( Slideshow.footerDebugOn, this )); $( document ).on( 'slideshow.debug.off', $.proxy( Slideshow.footerDebugOff, this )); $( document ).on( 'slideshow.keys', $.proxy( Slideshow.footerKeys, this )); } Slideshow.footerAddStyles = function() { this.debug( 'add builtin footer/header css via inline style elements' ); var styleProjection = "<style media='screen,projection'> \n"+ " .layout #footer.debug, \n"+ " .layout footer.debug { background: #CCF; } \n"+ " \n"+ " .layout #header.debug, \n"+ " .layout header.debug { background: #FCC; } \n"+ "</style>"; $( 'head' ).append( styleProjection ); } Slideshow.footerAddStyles(); Slideshow.footerAddEvents();