view static/js/sat_website.js @ 49:6cf0808b8275

update specifications.html with auto-generated templates
author souliane <souliane@mailoo.org>
date Sun, 03 May 2015 22:40:07 +0200
parents 9d553570cc61
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(); });
    });

});