jQuery slider color picker / slider to change background -
jQuery slider color picker / slider to change background -
i'm trying do:
decreasing temperature values of slider, need circle represents star gradually increment , alter background color link: http://astro.unl.edu/naap/hr/animations/hrexplorer.html
but code isn't doing it.....see lines $("#s_tem").slider({ see code: http://jsfiddle.net/nxnxj/19/
thanks..
you assigning variable chosencolor values like: #597459745974
which not valid css color attributes.
[edit] here's code should going:
$("#s_tem").slider({ change: function(event, ui) { var hexvalue = ui.value.tostring(16).touppercase(); if (hexvalue.length < 2) hexvalue = "0" + hexvalue; var chosencolor = numbertohexcolor(hexvalue); $('#t_tem').val(chosencolor); $("#star").css('background-color', chosencolor); }, value: 5800, min: 2300, max: 40000, step: 100, }); function numbertohexcolor(number) { var hexcolor = '' + number; while (hexcolor.length < 6) { hexcolor = '0' + hexcolor; } homecoming '#'+ hexcolor; }
jquery slider color-picker
Comments
Post a Comment