Ich habe clipboardjs erfolgreich eingerichtet. Jetzt füge ich ein Framework für Designzwecke hinzu.clipboardjs funktioniert nicht beim Zuweisen der Klasse mit Leerzeichen
Es funktioniert alles nur dann, wenn ich eine neue Klasse zu der Schaltfläche "kleine Schaltfläche" hinzufügen, als es nicht mehr funktioniert. Bevor ich einen Knopf benutze, wird es sehr gut funktionieren.
Ich denke, es gibt eine einfache Antwort, aber ich denke, ich habe das falsche Blick auf das Problem.
Dies ist nicht funktionierendes Beispiel:
<script>
var clipboard = new Clipboard('.small button');
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
}); < /script>
<div class="result">
<label>E-Mail Code:</label>
<p>
<textarea id="emailcode">
<?=$image;?>
</textarea>
</p>
<p>
<button class="small button" data-clipboard-action="copy" data-clipboard-target="#emailcode">
Copy to clipboard
</button>
</p>
<label>Digistore24 Code:</label>
<p>
<textarea id="ds24code">
<?=$ds24;?>
</textarea>
</p>
<p>
<button class="small button" data-clipboard-action="copy" data-clipboard-target="#ds24code">
Copy to clipboard
</button>
</p>
</div>
Dies ist das Arbeitsbeispiel:
<script>
var clipboard = new Clipboard('.btn');
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
}); < /script>
<div class="result">
<label>E-Mail Code:</label>
<p>
<textarea id="emailcode">
<?=$image;?>
</textarea>
</p>
<p>
<button class="btn" data-clipboard-action="copy" data-clipboard-target="#emailcode">
Copy to clipboard
</button>
</p>
<label>Digistore24 Code:</label>
<p>
<textarea id="ds24code">
<?=$ds24;?>
</textarea>
</p>
<p>
<button class="btn" data-clipboard-action="copy" data-clipboard-target="#ds24code">
Copy to clipboard
</button>
</p>
</div>
Sie müssen genauer sein, was das Problem ist. "Nicht funktionieren" zu sagen ist nicht hilfreich - kopiere die Fehlermeldung (en) in die Frage oder beschreibe zumindest die Symptome – Tibrogargan