开发者

jQuery colorpicker as slider with grey color range

开发者 https://www.devze.com 2023-04-13 04:06 出处:网络
I want to build a javascript function on my w开发者_高级运维ebsite to switch the text color within a grey scale of colors. I\'ve searched on google but found nothing as I wanted it. What do I go about

I want to build a javascript function on my w开发者_高级运维ebsite to switch the text color within a grey scale of colors. I've searched on google but found nothing as I wanted it. What do I go about creating the range (probably calculated from a start and end values) and reading the user input's on a slider to know what to do?

Cheers!


I didn't find any ready-made solutions, but you can use the Slider control from jQueryI UI to create a one-dimensional color picker. I put together a quick jsfiddle to demonstrate. When the user moves the slider, the "slide" event fires and my function changes the background color of a div. You can change the styling of the slider and the #color div to suit your needs.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号