Robis Posted November 18, 2003 Report Share Posted November 18, 2003 Sveiki! Kaa lai uztaisa uz JavaScript taa, lai teiksim, uzejot uz viena td (tabulas shuunas), taas kraasa un robezhas kraasa (border color) nomainaas un noejot nost aiziet uz veco, savukaart noklishkjinot uz shiis shuunas, kraasa nomainaas veel saaadaak??? :ph34r: Link to comment Share on other sites More sharing options...
sorehead Posted November 19, 2003 Report Share Posted November 19, 2003 Sākumam pietiks, tur protams jāizmanto f-jas, un citas labas lietas.. Ja gribi, lai dzeltenais paliek aktīvs, tad var izmantot globālos mainīgos. <table> <tr> <td onmouseover="this.style.backgroundColor='red'; this.style.border='1px solid blue';" onmouseout="this.style.backgroundColor='transparent'; this.style.border='transparent'"; onclick="this.style.backgroundColor='yellow';"> te paspaidiit... </td> </tr> </table> Link to comment Share on other sites More sharing options...
Robis Posted November 19, 2003 Author Report Share Posted November 19, 2003 (edited) Paldies, tieshaam straadaa :) ... vismaz uz Mozillas un IE browseriem... P.S. Varbuut zini, kaa to uztaisiit taa, lai vinjsh peec onmouseover nomainai tai shuunai nevis style, bet class, kas jau ieprieksh defineeta css failaa??? Edited November 19, 2003 by Robis Link to comment Share on other sites More sharing options...
sorehead Posted November 19, 2003 Report Share Posted November 19, 2003 (edited) Piemērs: http://oic.lv/~janis/tmp/csschange.html Edited November 19, 2003 by sorehead Link to comment Share on other sites More sharing options...
laacz Posted November 19, 2003 Report Share Posted November 19, 2003 Sākumam pietiks, tur protams jāizmanto f-jas, un citas labas lietas.. Ja gribi, lai dzeltenais paliek aktīvs, tad var izmantot globālos mainīgos. [... cut ...] Es gan rakstītu mazliet universālāk: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Test</title> <script type="text/javascript"> // mainīgais, kurš temporāri glabās veco background vērtību var tmp = ''; // norādām krāsu, uz kuru mainīt var color = '#ccc'; function mover(what) { // funkcija nomaina tabulas rowa (vai cita elementa) background krāsu tmp = what.style.backgroundColor; what.style.backgroundColor = color; } function mout(what) { // funkcija nomaina atpakaļ tabulas rowa (vai cita elementa) background // krāsu uz veco (kura glabājas iekš mainīgā 'tmp' what.style.backgroundColor = tmp; } </script> </head> <body> <table summary="Tabula testiem"> <tr onmouseover="mover(this);" onmouseout="mout(this)"> <td>viens</td> <td>divi</td> </tr> </table> </body> </html> Link to comment Share on other sites More sharing options...
des Posted December 8, 2003 Report Share Posted December 8, 2003 Lai pamainiitu elementa klasi, lietojam: onMouseOver="this.className=overclass" onMouseOut="this.className=defaultclass", kur overclass un defaultclass ir attieciigo klashu vaardi. Link to comment Share on other sites More sharing options...
Robis Posted January 1, 2004 Author Report Share Posted January 1, 2004 Lai pamainiitu elementa klasi, lietojam:onMouseOver="this.className=overclass" onMouseOut="this.className=defaultclass", kur overclass un defaultclass ir attieciigo klashu vaardi. Šis nestrādā ne uz IE 6, ne uz Mozilla!!! Link to comment Share on other sites More sharing options...
des Posted March 29, 2004 Report Share Posted March 29, 2004 Straadaa gan :) Tikai ieksheejaas peedinjas aatrumaa bija aizmirsies uzlikt :) Man domaat, ka tas tachu ir pashsaprotami, ka javascriptaa, pieskjirot textu kaut kaadam propertijam, tas ir jaalieliek peedinjaas... onMouseOver="this.className='overclass'" onMouseOut="this.className='defaultclass'", Link to comment Share on other sites More sharing options...
bubu Posted March 30, 2004 Report Share Posted March 30, 2004 ai ka nemaakam DOM un CSS specifikaciju lasiit! :) Link to comment Share on other sites More sharing options...
des Posted March 30, 2004 Report Share Posted March 30, 2004 Nemaakam gan, tas tiesa :) a kas ir DOM specifikaacija? :D Link to comment Share on other sites More sharing options...
Fatalis Posted March 30, 2004 Report Share Posted March 30, 2004 bubu, neko teikt. Izcēlies. http://alistapart.com/articles/tableruler/ Link to comment Share on other sites More sharing options...
des Posted March 30, 2004 Report Share Posted March 30, 2004 Fatalis, tas ir labs, liidz taadai konstrukcijai nebiju aizdomaajies - lielu tabulu gadiijumaa tas ljoti samazina gala html izmeeru! Link to comment Share on other sites More sharing options...
bubu Posted March 30, 2004 Report Share Posted March 30, 2004 DOM ir Document Object Model, tajaa aprakstiits kaadiem elementiem/objektiem saistiitiem ar HTML ir konkreeti kaadi propertiji un metodes JavaScriptaa. specifikaacijas ieksh -> www.w3.org Link to comment Share on other sites More sharing options...
des Posted March 30, 2004 Report Share Posted March 30, 2004 aaa, ok skaic :) vieniigais es gan par html objektu propertiju un metozhu javscriptaa manuaali parasti izmantoju: http://msdn.microsoft.com/library/default.asp Link to comment Share on other sites More sharing options...
Recommended Posts