The default 'text-shadow' for white text in a <div>
is defined as follows:
When the text color is changed to #627CA9
by clicking on it, I want the 'text-shadow' to be updated to match the new color.
text-shadow: 0 0 1px #FFFFFF, 0 0 2px #FFFFFF, 0 0 4px #FFFFFF;
I want to include the following:
text-shadow: 0 0 1px #627CA9, 0 0 2px #627CA9, 0 0 4px #627CA9;
I am unsure if this can be directly implemented using JavaScript. Any assistance on this matter would be greatly appreciated.
Thank you in advance for your help. Apologies for any inaccuracies in my English.
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
}
function changeColor(id) {
var x = document.getElementById(id);
if (x.style.color != "rgb(255, 255, 255)")
x.style.color = "#FFFFFF";
else {
x.style.color = "#627CA9"; // forecolor
}
}
.centered {
cursor: pointer;
font-family: Soft Press W00 Regular V1, cursive;
color: #FFFFFF;
text-shadow: 0 0 1px #FFFFFF, 0 0 2px #FFFFFF, 0 0 4px #FFFFFF;
text-transform: uppercase;
font-size: 80px;
margin: 0;
padding: 0;
line-height: 100%;
display: block;
font-weight: 400;
}
<div onclick="changeColor('myid1'); return false;" id="myid1" class="centered">89 ROCK</div>