Nun, ich versuche, ein Logo mit css
und html
zu machen und hier ist die Ausgabe:Anfügen Element jedes div um
jetzt möchte ich dies mit jquery
machen und Erstellen Sie alle div
dynamisch. das ist, was ich bisher getan haben:
var count = 13;
var n = 0;
for(var i = 0; i < count; i++) {
n++;
$('<div class="LogoRow" id="LogoRow-'+n+'"></div>').appendTo('#Logo');
}
$('#Logo .LogoRow:nth-child(odd)').addClass('LogoRowLeft');
$('#Logo .LogoRow:nth-child(even)').addClass('LogoRowRight');
$('.LogoRow').each(function() {
var count = 8;
for(var i = 0; i < count; i++) {
$(this).append('<span class="LogoTriangle"></span>');
}
});
I 13 beigefügten LogoRow
-#Logo
dann 8 LogoTriangle
zu jedem LogoRow
aber das Problem ist es LogoTriangle
anders, wie diese anhängen soll:
append 8 `LogoTriangle` to `LogoRow` nth child 1
append 7 `LogoTriangle` to `LogoRow` nth child 2 and 3
append 6 `LogoTriangle` to `LogoRow` nth child 4 and 5
append 5 `LogoTriangle` to `LogoRow` nth child 6 and 7
append 4 `LogoTriangle` to `LogoRow` nth child 8 and 9
append 3 `LogoTriangle` to `LogoRow` nth child 10 and 11
append 2 `LogoTriangle` to `LogoRow` nth child 12 and 13
append 1 `LogoTriangle` to `LogoRow` nth child 14 and 15
aber ich habe keine Ahnung, wie ich ein Element an ein anderes Element wie dieses anhängen kann. irgendwelche vorschlagen?
warum nicht svg benutzen? – madalinivascu
Weil ich css3 Animation für dieses Logo @ madalinivascu verwenden möchte, habe ich bereits dieses Logo im Svg-Format. – Pedram
@pedram Ich machte eine [Demo] (https://jsfiddle.net/czc6bhgw/6/) nicht so poliert, aber es sieht aus wie die CSS-Version – guradio