Wuu Posted February 12, 2008 Report Share Posted February 12, 2008 (edited) Visu tekstu kas iekš lol liekam citā krāsā <script language="JavaScript"><!-- function recolor() { document.getElementById('lol').style.color = '#ddaf7b'; style.color = 'red'; //<-- uz linka kura es uzklikoju krasojam sarkanu } //--> </script> php links echo '<a href="java script:ajaxpage(\'textrun.php?id='.$id.'\', \'ajax\');" onclick="recolor()"><div id="lol">'.$pname.'</div></a><br>'; Kāpēc nestrādā ja abas daļas atsevišķi tad strādā :( Vai Java Skriptā ir jātaisa loopi pāri visiem id utt ? Edited February 12, 2008 by Wuu Link to comment Share on other sites More sharing options...
Vebers Posted February 12, 2008 Report Share Posted February 12, 2008 (edited) echo '<a href="java script:ajaxpage(\'textrun.php?id='.$id.'\', \'ajax\');" onclick="recolor(this)"><div id="lol">'.$pname.'</div></a><br>'; <script language="JavaScript"><!-- function recolor(element) { document.getElementById('lol').style.color = '#ddaf7b'; element.style.color = 'red'; //<-- uz linka kura es uzklikoju krasojam sarkanu } //--> </script> Ir janorada kuram linkam tiesi mainisi krasu (kuram elementam). ar recolor(this) - padod elementu (to pasu <a></a>) edit: nav jātaisa loopi pāri pa ID, jo ID izsaka visu (tas ir unikāls, tātad tikai viens elements ar tādu id drīkst parādīties iekš html) Edited February 12, 2008 by Vebers Link to comment Share on other sites More sharing options...
Wuu Posted February 12, 2008 Author Report Share Posted February 12, 2008 (edited) onclick="document.getElementsByClassName(\'linkt\').style.color = \'red\';" Kāpēc nestrādā? Edited February 12, 2008 by Wuu Link to comment Share on other sites More sharing options...
Vebers Posted February 12, 2008 Report Share Posted February 12, 2008 Vari izmantot klasi, jo tas ir valīdi. Link to comment Share on other sites More sharing options...
marcis Posted February 12, 2008 Report Share Posted February 12, 2008 onclick="document.getElementsByClassName(\'linkt\').style.color = \'red\';" Kāpēc nestrādā? Ja gribi izmantot šādu pieeju, tad onclick="this.style.color='red';" Link to comment Share on other sites More sharing options...
Wuu Posted February 12, 2008 Author Report Share Posted February 12, 2008 Palīdziet man kaut kā nekas nestrādā :( Piemēram man ir kaudze linku ar class='links' zilā krāsā! es gribu tā lai uz kuru es uzklikšķinu tas paliek sarkans pārējie zili! Tā lai dinamiskos tabus lietojot var zināt kur esi uzspiedis. Link to comment Share on other sites More sharing options...
Aleksejs Posted February 12, 2008 Report Share Posted February 12, 2008 LoVe HAte Link Visited Href Active CSS pseidoklases http://www.adobe.com/cfusion/communityengi...1&loc=en_US Link to comment Share on other sites More sharing options...
Wuu Posted February 12, 2008 Author Report Share Posted February 12, 2008 LoVe HAteLink Visited Href Active CSS pseidoklases http://www.adobe.com/cfusion/communityengi...1&loc=en_US Tie ir ajax linki šitas nestrādā Link to comment Share on other sites More sharing options...
Earl Posted May 18, 2008 Report Share Posted May 18, 2008 A kā bez JavaScript var uzlikt, lai linki nav vis kā standarta linki (zilā krāsā, pasvītorti), bet gan parasta teksta veidā (bez tā "ziluma" un pasvītrojuma)? Tāpat arī - kā uztaisīt, lai 'visited' link paliek melns, nevis lillā? Link to comment Share on other sites More sharing options...
andrisp Posted May 18, 2008 Report Share Posted May 18, 2008 Vispār ar Javascript to parasti vispār nedara. :) CSS: a { color: black; text-decoration: none; } Bet vispār tā ir reti laba doma pataisīt linkus tādus pašus kā parasto tekstu. Protams, es nezinu, ko tu taisi. Link to comment Share on other sites More sharing options...
Earl Posted May 20, 2008 Report Share Posted May 20, 2008 (edited) Hm.. kaut kā nesanāk... Taisu menu ar teksta linkiem, negribu svītras apakšā ;) Edited May 20, 2008 by Earl Link to comment Share on other sites More sharing options...
Aleksejs Posted May 20, 2008 Report Share Posted May 20, 2008 Nu, ja nesanāk "kaut kā", tad pamēģini "nedaudz savādāk". Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 20, 2008 Report Share Posted May 20, 2008 a.mana_klase:link { font-size: 12px; color: #ff0000; font-family: arial, helvetica, sans-serif; font-weight: none; text-decoration: none; } a.mana_klase:visited { font-size: 12px; color: #00ff00; font-family: arial, helvetica, sans-serif; font-weight: none; text-decoration: none; } a.mana_klase:hover { font-size: 12px; color: #0000ff; font-family: arial, helvetica, sans-serif; font-weight: none; text-decoration: none; } un <a href="http://www.zaebalo.com" class="mana_klase">hmm ljoti intresanti</a> P.S. tas links ir jautrs --> cilveku izdomai nav robezju ;) Link to comment Share on other sites More sharing options...
Recommended Posts