3 Replies - 4499 Views - Last Post: 07 April 2015 - 04:44 PM

#1 garlant   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 04-April 15

jQuery plugin slick (carousel) not working with link (center mode)

Posted 04 April 2015 - 07:11 AM

thats my code, but is the same for original. I need to active link after banner is in center, not in transition to center. Im using (center mode from http://kenwheeler.github.io/slick/)
  <div class="stack">

    <div class="boxes">
       <h1><a id="l1" href="http://example.com">1</a></h1>

       </div>
    <div class="boxes">
         <h1><a id="l2" href="http://example.com">2</a></h1>

    </div>
    <div class="boxes">
        <h1><a id="l3" href="http://example.com">3</a></h1>

    </div>
    <div class="boxes">
         <h1><a id="l4" href="http://example.com">4</a></h1>

    </div>
    <div class="boxes">
        <h1><a id="l5" href="http://example.com">5</h1>

    </div>
    <div class="boxes">
        <h1><a id="l6" href="http://example.com">6</a></h1>

    </div>
</div>
  
  <script type='text/javascript'>
    

    var slick = $('.stack').slick({
        centerPadding: '160px',
        centerMode: true,
        infinite: true,
        arrows: false,
        draggable: false,
        touchMove: true,
        variableWidth: true,
        dots: false,
        swipeToSlide: true,
        slidesToShow: 3,
        slidesToScroll: 3,
        focusonselect: true,
        mobileFirst: true
       });

    var slider = $('.slider').slider({
        max: 100,
        min: 0,
        value: 93
    });

    $(".slider").on("slide mouseenter mousedown", function (event) {
        event.stopPropagation();
    });

    var highlightDiv = document.getElementById('highlight');
    var slideIndex = highlightDiv.getAttribute('data-slick-index');
     var l3 = document.getElementById('l3');

    if ((highlightDiv.className == 'slick-center') || (slideIndex == 1)) {
        $('#highlight').addClass('red');
       }


</script>


Is This A Good Question/Topic? 0
  • +

Replies To: jQuery plugin slick (carousel) not working with link (center mode)

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6260
  • View blog
  • Posts: 24,030
  • Joined: 23-August 08

Re: jQuery plugin slick (carousel) not working with link (center mode)

Posted 04 April 2015 - 10:57 AM

Moved to jQuery forum.
Was This Post Helpful? 0
  • +
  • -

#3 fatihmert   User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 137
  • Joined: 04-March 12

Re: jQuery plugin slick (carousel) not working with link (center mode)

Posted 05 April 2015 - 02:24 AM

Did you can CSS's text-align method to align center stack class?

.stack{
    text-align:center;
}


Was This Post Helpful? 0
  • +
  • -

#4 garlant   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 04-April 15

Re: jQuery plugin slick (carousel) not working with link (center mode)

Posted 07 April 2015 - 04:44 PM

I chance the solution!

https://css-tricks.com/moving-boxes/

this solve my problem
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1