Slider dots in modal invisible (solved), same with map (not yet)

Hello guys!

1. Strange problem — slider dots in modal don’t appear, but if I make modal display from none to block (so u can see it when site opened) slider dots appeared.



2. Map in modal window doesn’t appear (u can open it by clickin link under H1 heading).


Designer: https://preview.webflow.com/preview/cars-test?preview=830bf7709e1a75f6dbdcea5e8cdcad9a
Live: http://cars-test.webflow.io

Preview link is broken until further notice. Please re-post your share link when it is fixed.

Oh, sry, here it is: https://preview.webflow.com/preview/cars-test?preview=830bf7709e1a75f6dbdcea5e8cdcad9a

Hi @ForFood, I am unable to see your slider and map on the page. Could you add interactions to open your custom modal?

Hm, don’t get it, but made 1 modal visible, it’s slider dots are visible too, but if u close it and open another car, dot’s aren’t visible.
Designer: https://preview.webflow.com/preview/cars-test?preview=830bf7709e1a75f6dbdcea5e8cdcad9a
Live: http://cars-test.webflow.io

This looks like a bug. Sliders have to be visible in the page on load, otherwise JS error

webflow.35c9bd168.js:3800 Uncaught TypeError: Cannot read property ‘mask’ of undefined

Hi @ForFood, as mentioned by @samliew, since the slider is set to display none on load, the widget does not work as expected when the modal window is opened.

In the custom code where you have the fadein code, replace that with the below:

<script type="text/javascript">
$(document).ready(function() {
  $('.car-link-block-1').click(function() {
    $('.modal-background-1').fadeIn();
    Webflow.require('slider').redraw();
  });
  $('.close-modal-btn').click(function() {
    $('.modal-background-1').fadeOut();
  });
});
  
  $(document).ready(function() {
  $('.car-link-block-2').click(function() {
    $('.modal-background-2').fadeIn();
    Webflow.require('slider').redraw();
  });
  $('.close-modal-btn').click(function() {
    $('.modal-background-2').fadeOut();
  });
});

  $(document).ready(function() {
  $('.car-link-block-3').click(function() {
    $('.modal-background-3').fadeIn();
    Webflow.require('slider').redraw();
  });
  $('.close-modal-btn').click(function() {
    $('.modal-background-3').fadeOut();
  });
});

  $(document).ready(function() {
  $('.adress-link-block').click(function() {
    $('.modal-background-4').fadeIn();
    Webflow.require('slider').redraw();
  });
  $('.close-modal-btn').click(function() {
    $('.modal-background-4').fadeOut();
  });
});
</script>

This code above adds the Webflow.require(‘slider’).redraw(); command to redraw the slider after the modal is opened.

I did not have a chance to check the map yet…

After replacing the code, republish the site. I hope that helps.

2 Likes

Oh, big thanks, it works!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.