- Posts: 14105
- Thank you received: 2563
Ask the community, share ideas, and connect with other LimeSurvey users!
Thanks, just for information (and other user) : how do you manage the emoji ? With class ?rickanderson wrote: I'm managing to access the slider values using your code (I had to change $(this).value() to $(this).val()) so should now be able to use these to customise the slider handles, fantastic!
Yes, but it's hard to do a global theme.tpartner wrote: Or, even better, a custom question theme.
I would use question attributes/settings to define the emoji break points so they could be adjusted for any slider scale.For example : if slider have 5 value : need a system to choose emoji.
.slider .slider-handle.custom::before { display: inline-block; width: 20px; height: 20px; margin-top: 5px; margin-left: 5px; border-radius: 20px; background: transparent url(../files/slider00.png) center center no-repeat; background-size: cover; content: ''; }
Yes, maybe only need update class , something like :rickanderson wrote: I haven't had time so far but I'm hoping to just read the slider value and update the background image appropriately.
$(this).closest(".answer-item").find(".slider-handle").removeClass("emoji-1 emoji-2 emoji-3 emoji-4 emoji-5 emoji-6 emoji-7 emoji-8 emoji-9 emoji-10").addClass("emoji-"+$(this).value());
$(this).closest(".slider-item").find(".slider-handle").removeClass("emoji0 emoji1 emoji2 emoji3 emoji4 emoji5 emoji6 emoji7 emoji8 emoji9 emoji10").addClass("emoji"+$(this).val());