X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/e8813ee4389a5e22df46d1973409d70a8e6706be..dea6c21568101405287d143a86856d7f8d013a5b:/prawokultury/static/js/promobox.js?ds=inline diff --git a/prawokultury/static/js/promobox.js b/prawokultury/static/js/promobox.js index 91128ca..0c2235f 100644 --- a/prawokultury/static/js/promobox.js +++ b/prawokultury/static/js/promobox.js @@ -17,24 +17,56 @@ var change_slide = function(slide_no) { }; -$switchers.each(function(i, e) { - $(e).click(function(e) { - e.preventDefault(); - change_slide(i); - }); -}); - - var timeout = null; var cycle_slide = function() { var current = $slides.filter('.active').index(); change_slide((current + 1) % $slides.length); } + + var reset_timeout = function() { clearTimeout(timeout); timeout = setTimeout(cycle_slide, 5000); }; -timeout = setTimeout(cycle_slide, 3000); -}); \ No newline at end of file +if ($slides.length > 1) { + $switchers.each(function(i, e) { + $(e).click(function(e) { + e.preventDefault(); + change_slide(i); + }); + }); + + timeout = setTimeout(cycle_slide, 3000); +} + + +/* +if (!$('#id_presentation').checked) { + $('[id^="id_presentation_"]').parent().parent().hide(); +} +if (!$('#id_workshop').checked) { + $('[id^="id_workshop_"]').parent().parent().hide(); +} + +$('#id_presentation').change(function() { + if (this.checked) { + $('[id^="id_presentation_"]').parent().parent().show('slow'); + } else { + $('[id^="id_presentation_"]').parent().parent().hide('slow'); + } +}); + +$('#id_workshop').change(function() { + if (this.checked) { + $('[id^="id_workshop_"]').parent().parent().show('slow'); + } else { + $('[id^="id_workshop_"]').parent().parent().hide('slow'); + } +}); +*/ + + + +});