
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 |
$(document).ready(function() {
$('#noklick').fadeOut('fast', function() { });
});
$('#klicken').click(function() {
$('#klicken').fadeOut('slow', function() { });
$('#noklick').fadeIn('slow', function() { });
});
$('#noklick').click(function() {
$('#wait').slideUp(300).delay(800).fadeIn(300);
alert("Wie gesagt, tun Sie's nicht!");
)};
|
Stilseite (Aktuelle Version: 1.1.0)
Stilseite (Aktuelle Version: 1.1.0)Stimmt, sorry.Eigentlich sind die Rauten richtig, JQuery nimmt CSS-Formate, also $('#id'), $('.class.class div') und so weiter.

|
|
HTML |
1 2 3 4 5 |
var obj = $('#obj'); obj.fadeIn('slow'); obj.bla(); obj.blub(); |
|
|
HTML |
1 |
zB: obj.on("click", notify);
|
|
|
HTML |
1 2 |
function notify() { alert("clicked"); }
$("button").on("click", notify);
|
|
|
HTML |
1 |
$('#obj').fadeOut('slow'); |
Wieso denn das? Kleine Eventfunktionen bekommen bei mir niemals nen Namen, da wird man ja dusselig, wenn ich für jede success, o.ä. Funktion eine eigene benannte Funktion anlegen muss.vermeide Anonyme Funktionen.
Stilseite (Aktuelle Version: 1.1.0)|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<body>
<div id="ausgabe">
Klick hier um das Anmeldeformular zu öffnen!
</div>
<form method="post" action="" id="mf">
<input type="text" name="test" /><input type="button" id="button" value="Testbutton" />
</form>
<div id="output">
<? echo $_POST['test']; ?>
</div>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$('#mf').fadeOut('slow', function() { });
$('#test').fadeOut('slow', function() {});
});
$('#ausgabe').click(function() {
$('#ausgabe').fadeOut('slow', function() { });
$('#mf').fadeIn('slow', function() { });
});
$('#button').click(function() {
$('#mf').fadeOut('slow', function() { });
$('#output').fadeIn('slow', function() { });
});
</script>
</body>
|
Stilseite (Aktuelle Version: 1.1.0)|
|
Source code |
1 |
$('#test').fadeOut('slow', function() {});
|
Stilseite (Aktuelle Version: 1.1.0)
Stilseite (Aktuelle Version: 1.1.0)
Stilseite (Aktuelle Version: 1.1.0)Forum Software: Burning Board® 3.1.7, developed by WoltLab® GmbH