From 80a3f2b584f99b204091e82e5580e3a32cb82a64 Mon Sep 17 00:00:00 2001 From: Lourguioui Date: Thu, 13 Feb 2020 01:21:27 +0100 Subject: [PATCH] responsive 1 --- assets/js/dino.js | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/assets/js/dino.js b/assets/js/dino.js index ba4be8d..3d56d60 100644 --- a/assets/js/dino.js +++ b/assets/js/dino.js @@ -45,7 +45,7 @@ var $element_height = $element.outerHeight(); var $element_top_position = $element.offset().top; var $element_bottom_position = ($element_height + $element_top_position); - console.log($element_bottom_position) + if(($element_bottom_position >= $window_top_position) && ($element_top_position <= $window_bottom_position)){ $element.animate({left : '0px',opacity : '1'}, "slow"); @@ -59,7 +59,7 @@ var $element_height = $element.outerHeight(); var $element_top_position = $element.offset().top; var $element_bottom_position = ($element_height + $element_top_position); - console.log($element_bottom_position) + if(($element_bottom_position >= $window_top_position) && ($element_top_position <= $window_bottom_position)){ $element.animate({right : '0px',opacity : '1'}, "slow"); @@ -74,44 +74,6 @@ /*============================ end objectifs animations ================================*/ /*============================= thematique animations ===============================*/ - /* var $animation_element_them = $(".them.animated-element-left"); - var $animation_element_right_them = $(".them.animated-element-right"); - var $window = $(window); - function check_in_view(){ - var $window_height = $window.height(); - var $window_top_position = $window.scrollTop(); - var $window_bottom_position = ($window_top_position + $window_height); - $.each($animation_element_them, function (){ - var $element = $(this); - var $element_height = $element.outerHeight(); - var $element_top_position = $element.offset().top; - var $element_bottom_position = ($element_height + $element_top_position); - console.log($element_bottom_position) - if(($element_bottom_position >= $window_top_position) && ($element_top_position <= $window_bottom_position)){ - $element.animate({left : '0',opacity : '1'}, "slow"); - - - }else{ - // $element.animate({right : "200px",opacity : 'O'}, "slow"); - } - }) - $.each($animation_element_right_them, function (){ - var $element = $(this); - var $element_height = $element.outerHeight(); - var $element_top_position = $element.offset().top; - var $element_bottom_position = ($element_height + $element_top_position); - console.log($element_bottom_position) - if(($element_bottom_position >= $window_top_position) && ($element_top_position <= $window_bottom_position)){ - $element.animate({right : ' 0px',opacity : '1'}, "slow"); - - - }else{ - // $element.animate({right : "200px",opacity : 'O'}, "slow"); - } - }) - } - $window.on('scroll', check_in_view); - $window.trigger('scroll');*/ /*============================= mobile cards ==========================================*/ /*=====================================================================================*/