admin管理员组

文章数量:1401122

I am using a slick carousel in a web page to pass through form data and info.

However I need to be able to select text inside the carousel. I thought that by setting draggable to false I would be able to select text, but the cursor shape changes to a text cursor but I still can not select text.

Is there a way around it?

I am configuring like this:

    $('.carousel').slick({
    prevArrow: '.btn-prev-cand',
    nextArrow: '.btn-next-cand',
    dots: false,
    speed: 500,
    infinite: true,
    accessibility: true,
    adaptiveHeight: false,
    arrows: true,
    centerMode: false,
    variableWidth: false,
    draggable: false,
    swipeToSlide: false
});

I am using a slick carousel in a web page to pass through form data and info.

However I need to be able to select text inside the carousel. I thought that by setting draggable to false I would be able to select text, but the cursor shape changes to a text cursor but I still can not select text.

Is there a way around it?

I am configuring like this:

    $('.carousel').slick({
    prevArrow: '.btn-prev-cand',
    nextArrow: '.btn-next-cand',
    dots: false,
    speed: 500,
    infinite: true,
    accessibility: true,
    adaptiveHeight: false,
    arrows: true,
    centerMode: false,
    variableWidth: false,
    draggable: false,
    swipeToSlide: false
});
Share Improve this question edited Jan 4, 2017 at 23:21 br3t 1,6582 gold badges21 silver badges28 bronze badges asked Jul 7, 2016 at 16:24 dabichodabicho 3934 silver badges19 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 7

Try to override this in css

.slick-slider {
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
.slick-list.draggable {
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

The problem that you described is a known issue - Selecting/Highlighting text #826

Try to put the setting "swipe" to false to disable the swiping and see the text cursor.

Colleague Martin's answer is great, but at the moment the text feature is supported in browsers, so there is no need at all to use moz webkit o

https://developer.mozilla/en-US/docs/Web/CSS/user-select#browser_patibility

It is enough just to write

.slick-list.draggable 
{
  user-select: text;
}

Also, there is no need to write

.slick-list.draggable {
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

It is enough just to write the above code

本文标签: javascriptjquery slick carousel copypasteStack Overflow