ich diesen Code verwenden, um ein Dia Knebel laufen, aber es lässt sich nicht öffnen, wenn ich darauf klicke:Slide Toggle [Jquery Funktion] funktioniert nicht
JS-Code:
<script type="text/javascript">
$(document).ready(function() {
alert('hi i came to toggle');
$(".flip").click(function() {
$(this).next().slideToggle("fast");
});
});
function ViewGetSubjects(data) {
var subjects = (typeof data) == 'string' ? eval('(' + data + ')') : data;
$('#subjects').empty();
for (var i = 0; i < subjects.length; i++)
{
$('#subjects').append('<h1 class = "flip">'+subjects[i].Wkp_lesson+'</h1><div class="panel" >' + ' Weekly Body: ' + subjects[i].Wkp_Body + ' Weekly Body: ' + subjects[i].Wkp_Body + ' Weekly Lesson: ' + subjects[i].Wkp_lesson + '</div>');
}
}
CSS:
div.panel,h1.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#488AC7;
border:solid 1px #F6358A;
}
div.panel
{
height:120px;
display:none;
}
Wissen Sie warum?
Vielen Dank :)
Was funktioniert hier nicht? Ich habe eine Geige für dich erstellt (http://jsfiddle.net/fvv2n/). Passen Sie den Code Ihren eigenen, insbesondere dem HTML-Code an. So wie es ist, es funktioniert. – Armatus
posten Sie Ihre HTML, und erstellen Sie ein Beispiel jsfiddle als @Armatus vorgeschlagen – DG3
Es gibt kein HTML :) Es ist nur:
– OnlyHope