Domanda

I have a jcarousel and double clicking next button results in the images being highlighted in blue, on Chrome only.

::selection { background: white;}
::-moz-selection {background: white;}

This fixes it but means one cannot select (or rather see you are selecting) text on any other parts of the site.

My jcarousel is within:

<ul id='product-id-232-carousel' class='product-carousel jcarousel-skin-tango'>

So I tried several variations of :

ul.product-carousel::selection { background: white;}
ul.product-carousel::-moz-selection {background: white;}

To try to restrict the white selection b/g to just the jcarousel but none work.

Thanks, Kevin

Found a solution:

Wrapped carousel in a div and applied this style:

.carouselnoselect{
    -webkit-user-select: none;  
    -moz-user-select: none;     
    -ms-user-select: none;     
    user-select: none;
    }
È stato utile?

Soluzione

This has nothing to do with ::selection and everything to do with your carousel plugin not preventing the default action of events properly.

Somewhere in jcarousel you should find a click handler for scrolling to next or previous items. It should have e.preventDefault() or similar in there, but from what you're saying I would guess it doesn't.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top