Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/script/blocs/bloc-global-sliders.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function sliderToggleHeaderAlign() {
var fn_slider = function (componentName, componentSliderClass, controlsPosition, nbItems576, nbItems992, nbItems1200, gutter = 30) {
var sliderElt = Array.from(document.querySelectorAll(componentName));

if(typeof(sliderElt) != 'undefined' && sliderElt != null) {
if(sliderElt !== undefined && sliderElt != null) {
sliderElt.forEach(function (slider) {
var parentElt = slider.querySelector(componentSliderClass);
// console.log(parentElt)
Expand Down
8 changes: 4 additions & 4 deletions src/script/blocs/bloc-m-key-figure.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $(function ($, win) {
r = el.getBoundingClientRect(),
t = r.top,
b = r.bottom;
return cb.call(el, Math.max(0, t > 0 ? H - t : (b < H ? b : H)));
return cb.call(el, Math.max(0, t > 0 ? H - t : Math.min(b, H)));
}
visPx();
$(win).on("resize scroll", visPx);
Expand All @@ -23,12 +23,12 @@ var fn_keyfigure_animated = function () {
// https://jsfiddle.net/medel/8qeyr6pt/
if ($('.m-key-figure--animated').length > 0) {
$(".m-key-figure--animated").inViewport(function (px) { // Make use of the `px` argument
var keyfigureNumber = $(this).text().replace(/\s/g, ""); // remove white space
var keyfigureNumber = $(this).text().replaceAll(/\s/g, ""); // remove white space
// if element entered V.port ( px>0 ) and
// if prop initNumAnim flag is not yet set
// if it's a number
// = Animate numbers
if (px > 0 && !this.initNumAnim && !isNaN(keyfigureNumber)) {
if (px > 0 && !this.initNumAnim && !Number.isNaN(Number(keyfigureNumber))) {
this.initNumAnim = true; // Set flag to true to prevent re-running the same animation

$(this).prop('Counter', 0).animate({
Expand All @@ -37,7 +37,7 @@ var fn_keyfigure_animated = function () {
duration: 2000,
easing: 'swing',
step: function (now) {
$(this).text(new Intl.NumberFormat('fr-FR').format(parseFloat(now).toFixed()));
$(this).text(new Intl.NumberFormat('fr-FR').format(Number.parseFloat(now).toFixed()));
}
});
}
Expand Down