view static/js/sat_website.js @ 34:9d553570cc61

add adhesion_form.html and thank_you.html
author souliane <souliane@mailoo.org>
date Tue, 27 Jan 2015 08:20:30 +0100
parents b45621706d83
children d54f2f09a73a
line wrap: on
line source

$(document).ready(function() {

    // language selector
    $('#language_select').change(function() {
        $('#language_form').submit();
    });
    
    // registration form
    $('#id_subscription_amount').change(function() {
        if ($(this).val() > 0) {
            $('#id_payment_method_group').show();
        } else {
            $('#id_payment_method_group').hide();
        }
    });

    // open the big gallery when a thumbnail is clicked
    $('#carousel-screenshots .thumbnail').click(function() {
        $('#modal-screenshots').modal('show');
        index = parseInt($(this).attr('index'));
        $('#carousel-screenshots-modal').carousel(index);
        // start playing the big video
        if ($(this)[0].tagName == 'VIDEO') {
           $('#carousel-screenshots-modal img, #carousel-screenshots-modal video')[index].play();
        }
    });
    
    // thumbail's video starts playing when clicked, pause it
    $('#carousel-screenshots video.thumbnail').each(function(index) {
        $(this).on('play', function(e) { $(this)[0].pause(); });
    });

});