daGrevis Posted November 15, 2010 Report Share Posted November 15, 2010 Sveiki, Esmu iesācējs jQ. Nekādīgi netieku gudrs, kāpēc skriptiņš nedarbojas... =( Ceru uz palīdzību. =) <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="Text/HTML; Charset=UTF-8" /> <title>Bliss</title> <script type="text/javascript" src="./javascripts/jquery-1.4.4.min.js"></script> <script type="text/javascript"> <!-- $(document).ready(function(){ $("input#remember_me").click(function(event){ $("p#shared_computer").fadeIn("slow"); }); }); //--> </script> <link href="./themes/default/style.css" type="text/css" rel="stylesheet" media="all" /> </head> <body> <form method="post" action="do__sign-in.php"> <p><label>Username: <input name="username" /></label> <strong>(*)</strong></p> <p><label>Password: <input name="password" type="password" /></label> <strong>(*)</strong></p> <p><label><input id="remember_me" name="remember_me" type="checkbox" /> Remember me!</label></p> <p id="shared_computer" class="small">[ Not recommended on a shared computer! ]</p> <p><input type="submit" value="Submit!" /></p> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
briedis Posted November 15, 2010 Report Share Posted November 15, 2010 (edited) Ir kādas kļūdas, kas lec laukā javascript konsolē? Vajadzētu strādāt, imo.. Gribētu ieteikt šādu js kodu likt htmlam apakšā. Pamēģini šo: $(document).ready(function(){ alert('Mēs esam te'); $("input#remember_me").change(function(){ alert('Tagad esam te'); if($(this).is(":visible")){ $("p#shared_computer").fadeOut("slow"); }else{ $("p#shared_computer").fadeIn("slow"); } }); }); Edited November 15, 2010 by briedis Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 15, 2010 Author Report Share Posted November 15, 2010 Manam kodam lec ārā... Warning: Unexpected token in attribute selector: '!'. Source File: http://localhost/bliss/sign-in.php Line: 0 Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 15, 2010 Author Report Share Posted November 15, 2010 Tavs kods darbojās. Vismaz alert'i. Kaut ko fade'oja, kaut ko nē... =( Varbūt CSS pie vainas... p#shared_computer { padding: 5px 0; visibility: hidden; } Quote Link to comment Share on other sites More sharing options...
briedis Posted November 15, 2010 Report Share Posted November 15, 2010 Nu skaties, kur tu kādā selektorā esi iemetis izsaukuma zīmi nevietā.. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 15, 2010 Author Report Share Posted November 15, 2010 Nu ja būtu tik vienkārši. Bet tur nav nevienas "!" zīmes, ja neskaita "<!--", ko izņemot tāpat nekas nemainās. =( Quote Link to comment Share on other sites More sharing options...
indoom Posted November 16, 2010 Report Share Posted November 16, 2010 visibility:hidden nevar iefeidot, jābūt display:none; ja jāizmanto visibility, tad $(el).css({opacity:0,visibility:'visible'}).animate({opacity:1}); Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 16, 2010 Author Report Share Posted November 16, 2010 Paldies, indoom un briedis. =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.