1
I have the following code that creates a clone of an image. When you hear a few 3 clones, delete the last one. Without appearing.
example:
if (id==3){
//apagar clone/imagem
}
example jsfiddle: http://jsfiddle.net/twsthyds/12/
1
I have the following code that creates a clone of an image. When you hear a few 3 clones, delete the last one. Without appearing.
example:
if (id==3){
//apagar clone/imagem
}
example jsfiddle: http://jsfiddle.net/twsthyds/12/
0
Hello, I updated your Fiddler, take a look.
I created a data-tag on the PAI images and I control who I exclude.
The section below, I put at the end of the method function mousedown(e)
.
var type = ddData.element.getAttribute('data-type');
var arrTmp = document.querySelectorAll('[data-type="'+type+'"]');
if(arrTmp.length>3){
var el = arrTmp[0];
el.parentNode.removeChild( el );
}
How did the html
<svg width="90%" height=500px>
<image data-type="img1" xlink:href=/favicon.png id=img1 x=0 y=0 height=20 width=20 class="img" />
<image data-type="img2" xlink:href=/favicon1.png id=img2 x=30 y=0 height=20 width=20 class="img" />
</svg>
See if it helps
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
managed to make?
– RBoschini
No jsddle works well, but in javascript without using jquery, it is also use remove()?
– akm
is that the browser does not work
– akm
cannot use with jquery?
– RBoschini
No, the console says $ is not defined
– akm
I updated to do without jquery, see the new Fiddler I posted http://jsfiddle.net/rboschini/twsthyds/30/
– RBoschini
worked now?
– RBoschini
Gave, thanks @Rboschini
– akm