G
G
grishaaa2016-12-19 19:30:23
JavaScript
grishaaa, 2016-12-19 19:30:23

Where to enter the slider code for correct display?

У меня скрытый блок в котором лежит слайдер, при клике на кнопку появляется блок со слайдером но сразу корректно не отображается слайдов не видно, а только после того как начнешь его листать.
Вот код который отвечает за вызов блока со слайдером
https://jsfiddle.net/o7rrjqqh/

Мне подсказали, что нужно код слайдера вставить в код который отвечает за вызов блока со слайдером
Вот код слайдера. Куда мне его вписать чтобы корректно отображался слайдер
jQuery('.slider').slick({
dots: false,
infinite: true,
speed: 500,
autoplaySpeed: 1000,
autoplay: false,
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Io, 2016-12-19
@vawsan

You can insert something at the end of a function that fires on click, but your code is clearly broken there.
You declare var scroll_el = $(this).attr('href')and it will just be the value of the attribute!
And then jQuery(scroll_el).slideDown(400);you try to animate it. Although they just checked in the ife that it (the string) is not empty. Animation on the attribute value will not work, because it's just a sequence of characters, not a page element.
Yes, and return is clearly superfluous there ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question