ziedinjsh Posted September 4, 2009 Report Share Posted September 4, 2009 (edited) kā iespējama tāda lieta: Atverot lapu vai kādu sadaļu parādās: <div id='loading'><img src='loading.gif'></div> kad ir ielādējies lapas saturs, tad loading div pazūd un parādas jauns div: <div id='content'>lapas saturs vai sadaļas saturs</div> Kāds varētu palīdzēt? Edited September 4, 2009 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
Web Developer Posted September 4, 2009 Report Share Posted September 4, 2009 AJAXam izmantot? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 4, 2009 Author Report Share Posted September 4, 2009 varbūt kāds var ieteikt kādu ajax scriptu? Quote Link to comment Share on other sites More sharing options...
cucumber Posted September 4, 2009 Report Share Posted September 4, 2009 (edited) <style> #content { display: none; } #loading{ display: block; } </style> <script> $ = function(id) { return document.getElementById(id); } function showContent() { $('loading').style.display = 'none'; $('content').style.display = ''; } </scirpt> <body onload="javascript:showContent()"> <div id='loading'><img src='loading.gif'></div> <div id='content'>lapas saturs vai sadaļas saturs</div> </body> Edited September 4, 2009 by cucumber Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 4, 2009 Author Report Share Posted September 4, 2009 (edited) Paldies cucumber, parādās div ar loading.gif un arī apakšā rādas content div.. Vai nav iespēja kaut kā uztaisīt, kad pazūd loading div tad tikai parādas content div? Edited September 4, 2009 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
cucumber Posted September 4, 2009 Report Share Posted September 4, 2009 css otrais samaini uz shito, tur divreizs content uzrasktiju un viss bus ok #loading{ display: block; } Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 4, 2009 Author Report Share Posted September 4, 2009 (edited) izdarīju tā.. CSS: #content{ display: none; border:1px solid #cccccc; background-color:#FFFFFF; padding:5px; margin-top:10px; } #loading{ display: block; padding:5px; margin-top:10px; } Tagad parādas loading.gif un pec tam tukšums.. content div nav Edited September 4, 2009 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 4, 2009 Report Share Posted September 4, 2009 Maybe papildini kodu, lai redzētu kas notiek kad ielādējas!? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 4, 2009 Author Report Share Posted September 4, 2009 Ja es saprastu kaut ko tad papildinātu.. kurā vietā Tu domā papildināt? Šo?: $('content').style.display = ''; Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 4, 2009 Report Share Posted September 4, 2009 Es domāju, kad ja ir ielādējies parāda tavu kodu, lai nav "tukša lapa"! Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 4, 2009 Author Report Share Posted September 4, 2009 nesaprotu ko tu centies pateikt.. :D KAd ielādējas tad vajag parādities <div id='content'>lapas saturs vai sadaļas saturs</div> bet neparādas.. kad noņemu no content nost display:block tad rādās, bet atkal nestrādā riktīgi ielādēšana.. parādās gan loading div gan content div Quote Link to comment Share on other sites More sharing options...
waplet Posted September 4, 2009 Report Share Posted September 4, 2009 uzgaidi... ieej dope.lv/jquery.js uztaisi sev tāu un tur redzesi ir visādi load php tur to un to.. pārlabo uz savējiem.. un liec attiecīgajiem <div> id.. un kr4 sapratīsi Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 4, 2009 Author Report Share Posted September 4, 2009 waplet, Tu kļūdījies, es nesapratu :D Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 6, 2009 Author Report Share Posted September 6, 2009 kāda kļūda tad īsti ir? <style> #content { display: none; } #loading{ display: block; } </style> <script> $ = function(id) { return document.getElementById(id); } function showContent() { $('loading').style.display = 'none'; $('content').style.display = ''; } </scirpt> <body onload="javascript:showContent()"> <div id='loading'><img src='loading.gif'></div> <div id='content'>lapas saturs vai sadaļas saturs</div> </body> Kad ir šitā tad refrešojot lapu parādās loading.gif, bet lapas content div neparādās.. nesaliekot pie diviem content display:none un loading display:block... tad refrešojot lapu parādas gan loading div gan content div, bet pēc brīža loading div pazūd.. it kā strādā, bet kā var panākt ar šo scriptu to kad pārādas loading div.. ielādējas lapas saturs.. pazūd loading div un parādas conten div?? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 6, 2009 Author Report Share Posted September 6, 2009 Vēlviena lieta ir tāda, ka uzspiežot uz linku viņš ielādē lapu, bet neparāda to loading div.. viņš to loading div rāda tikai tādā gadījumā kad uztais refreš lapu vajadzētu lai viņās atver lapu monāli un tad tikai rādā loading div.. tā viņš lapu ielādē jau caur browsera progressbar 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.