Skip to content

Commit

Permalink
Improve home page loading effect
Browse files Browse the repository at this point in the history
  • Loading branch information
mprunell committed Jan 21, 2021
1 parent 746c0ac commit c289526
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
53 changes: 28 additions & 25 deletions smallslive/templates/home_banners_carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,32 +155,35 @@
}
function becomeMember() {

window.location = '{% url 'become_supporter' %}';
}
window.location = '{% url 'become_supporter' %}';
}

$(document).ready(function () {
$('.banner-button-info').on('click', function() {
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$('.banner-button-info').on('mouseenter', function() {
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$('.banner-button-info').on('mouseleave', function() {
$('.carousel').slick('slickSetOption', 'autoplay', true).slick('slickPlay');
});
$('#becomeMemberDialog').on('mouseenter', function() {
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$('#becomeMemberDialog').on('mouseleave', function() {
$('.carousel').slick('slickSetOption', 'autoplay', true).slick('slickPlay');
});
$(document).ready(function () {
$('.banner-button-info').on('click', function() {
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$('.banner-button-info').on('mouseenter', function() {
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$('.banner-button-info').on('mouseleave', function() {
$('.carousel').slick('slickSetOption', 'autoplay', true).slick('slickPlay');
});
$('#becomeMemberDialog').on('mouseenter', function() {
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$('#becomeMemberDialog').on('mouseleave', function() {
$('.carousel').slick('slickSetOption', 'autoplay', true).slick('slickPlay');
});

$('.slick-track').on('click', function(){
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
})
$('.carousel').slick({ infinite: true, dots: true, arrows: false, autoplay: true, autoplaySpeed: 7000, pauseOnHover: false })
$('.slick-initialized').on('swipe', function(event, slick, direction){
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$('.slick-track').on('click', function(){
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
$(".carousel").on('init', function(event, slick) {
$("main").css("visibility", "visible");
});
$('.carousel').slick({ infinite: true, dots: true, arrows: false, autoplay: true, autoplaySpeed: 7000, pauseOnHover: false })
$('.slick-initialized').on('swipe', function(event, slick, direction) {
$('.carousel').slick('slickSetOption', 'autoplay', false).slick('slickPause');
});
});
</script> {% endblock %}
2 changes: 1 addition & 1 deletion smallslive/templates/home_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<div class="main-container pad-content {% if calendar %}calendar{% else %}home-new{% endif %}">
{% block home_content %}
<main>
<main style="visibility: hidden;">
{% include 'home_banners_carousel.html' %}
<div class="event-stripe">
{% include 'events/today_and_tomorrow.html' with custom_venue_style=True %}
Expand Down

0 comments on commit c289526

Please sign in to comment.