Non Linearly
asked on
Crossover diagonal lines over an html image
How can we draw two crossover (X) diagonal lines over an html image?
html
https://jsfiddle.net/HainKurt/bs7q6e38/
<div class=divContainer>
<img src="cat1.jpg">
<img class=imgCross src="cross.png">
</div>
<div class=divContainer>
<img src="cat2.jpg">
<img class=imgCross src="cross.png">
</div>
css.divContainer {
width: 400px;
position: relative;
}
.divContainer img {
width: 400px;
}
.imgCross {
position: absolute;
top: 0;
left: 0;
}
js$(".imgCross").each(function(){
var prvImg = $(this).prev();
$(this).width($(prvImg).width());
$(this).height($(prvImg).height());
});
https://jsfiddle.net/HainKurt/bs7q6e38/
Hain that is what I already suggested. But your fiddle is not working.
But your fiddle is not working.if you click RUN it works...
not sure not if it is not working in first load, will check...
update: I dont see any error/issue...
jsFiddle not running on initial load somehow...
but when you click run, it works as expected...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
You have several options. One is to replace the image with the "X" over the image. This can be done manually or via scripting. Another option would be to make the image a background image and add an "X" image over the background.
Open in new window
And the last option I can think of is to use absolute positioning and have HTML like below and use css to layer the twoOpen in new window