I have a click function that will change my image to another color.
$(document).on( "click", ".cor", function() {
var element = $(this);
var I = element.attr("data-c");
if(I=="Blue") {
var color = "Blue";
var c = "#47afff";
$("#changejs").attr("src", "/img-img/logo.png");
}
else if(I=="Lightblue"){
var color = "Lightblue";
var c="#349ff7";
$("#changejs").attr("src", "/img-img/logo_blue.png");
}
});
when user clicks in span color it will get the span color data-c and change the image based on its color. It works in chrome but not on ios safari. any ideas why?
<span class="cor Blue" data-c="Blue"></span>
<span class="cor Lightblue" data-c="Lightblue"></span>
the image to change:
<img id=changejs src="/img-img/logo_pink.png">