ERLEDIGT
NEIN
NEIN
ANTWORTEN
3
3
ZUGRIFFE
459
459
EMPFEHLEN
-
Guten Abend,
ich versuche die ganze zeit eine Animation zu schaffen, wo der box-shadow langsam verschwindet.
Soweit bin ich
HTML-Code:<form action="gaestebuch.php" method="post"> <table border="2" bordercolor="#000000" width="570px" align="center"> <tbody> <tr> <th align="left" width="80px"> Vorname: </th> <td> <input name="vorname" type="text" size="30" maxlength="30"> </td> </tr> <tr> <th align="left"> Nachname: </th> <td> <input name="nachname" type="text" size="30" maxlength="30"> </td> </tr> <tr> <th align="left"> E-Mail: </th> <td> <input name="email" type="text" size="30" maxlength="50"> </td> </tr> <tr> <th align="left" valign="top"> Text: </th> <td> <textarea name="text" id="text" cols="28" rows="5" onKeyUp="check()"> </textarea> </td> </tr> <tr> <th> </th> <td> <input name="submit" id="button" type="submit" value="Abschicken"> </td> </tr> </tbody> </table> </form>
Code css:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
input { border: 1px solid #666; border-radius: 5px; height: 20px; } textarea { border: 1px solid #666; border-radius: 5px; font-size: 12px; width:222px; } input:focus,textarea:focus { box-shadow: 0px 0px 1px 2px #6FF; }
Code javascript:1 2 3 4 5 6 7 8
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <script> $("input").focus(function () { $(this).animate({ boxShadow: '0 0 0 #FFF' }, 500 ); });
Aber wir ihr euch denken könnt läuft es nicht wie gewollt.
Will das der Box-shadow beim focus kurz aufleuchtet und dann wieder verschwindet.
Habt ihr da eine Idee?
-
25.12.11 23:21 #2
Ich würde $(this).css setzen und dann animate ausführen, ausserdem vor dem letztem ; einfach statt dem focus event auf dem blur event die css optionen wieder entfernen.
In etwa so:
Code :1 2 3 4 5 6 7
$("input").focus(function () { $(this).css('boxShadow', '0 0 0 #FFF'); $(this).animate(); }).blur(function(){ $(this).css('boxShadow', ''); $(this).animate(); });
Habe es nicht ausprobiert aber das sollte gehen.
-
Funktioniert leider nicht..
-
http://api.jquery.com/animate/All animated properties should be animated to a single numeric value
jQuery kann keine zusammengesetzten Werte animieren. Und Farben ebenfalls nicht.
Hier ist ein Plugin verlinkt: http://stackoverflow.com/questions/4...ow-with-jquery
Oder auch hier http://www.bitstorm.org/jquery/shadow-animation/
Ähnliche Themen
-
JQuery backgroundPosition animation
Von SonMiko im Forum Javascript & AjaxAntworten: 5Letzter Beitrag: 03.12.11, 20:21 -
JQuery Queuing-Problem beim Hovermenü und & ajax/Jquery Animation
Von Socimy im Forum Javascript & AjaxAntworten: 12Letzter Beitrag: 05.08.11, 07:33 -
jQuery: Art der Animation übergeben
Von DiDiJo im Forum Javascript & AjaxAntworten: 1Letzter Beitrag: 17.07.10, 10:39 -
jQuery: Animation
Von DerDaniel im Forum Javascript & AjaxAntworten: 14Letzter Beitrag: 08.04.10, 07:56 -
JQuery Animation
Von lisali im Forum Javascript & AjaxAntworten: 2Letzter Beitrag: 23.07.09, 20:57





Zitieren

Login





