ziedinjsh Posted February 25, 2010 Report Share Posted February 25, 2010 tā tad atkal man te problēmas ar css - vairāk ar mani nevis ar css :D php kods šāds: $languages = array('en','lv'); if (isset($_GET['lang']) && in_array($_GET['lang'],$languages)) { $_SESSION['lang'] = $_GET['lang']; } if (isset($_SESSION['lang']) && in_array($_SESSION['lang'], $languages)) { include 'lang/' . $_SESSION['lang'] . '.php'; } else { include 'lang/en.php'; } Links šāds: <a href='index.php?lang=en' ".(($lang == "en") ? "class='current'" : "")."></a> css šāds: #lang{ width:100px height:50px; float:right; } #lang .en a{ background-image:url(../misc/en_n.png); background-repeat:no-repeat; } #lang .en a:hover{ background-image:url(../misc/en.png); background-repeat:no-repeat; } #lang .en a .current{ background-image:url(../misc/en.png) background-repeat:no-repeat; } man nekas nerādās tas ir saprotams jo star <a href=''></a> tagiem nav nekā bet kā es varu uztaisīt to ka funkcionē tas css princips, bet javascriptiem? rādās valodas karogs neaktīvs, hover mainās bildes un uz current paliek tā bilde Paldies ieprieks :) Quote Link to comment Share on other sites More sharing options...
waplet Posted February 25, 2010 Report Share Posted February 25, 2010 Kā var būt kaut kas , ja neko neesi ielicis? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 25, 2010 Author Report Share Posted February 25, 2010 es nesaprotu kā to linku taisīt lai mainās tās bildes uz hover un current Quote Link to comment Share on other sites More sharing options...
waplet Posted February 25, 2010 Report Share Posted February 25, 2010 bet current jau strādā, bet tākā tagā nav iekša saturs,tad kas tur var aminītīes? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 25, 2010 Author Report Share Posted February 25, 2010 nu jā, tapēc es izdarīju šādi echo "<a href='index.php?lang=en' ".(($lang == "en") ? "class='current'" : "")."><div class='en'></div></a>"; vienalga nekas nerādas :? meiģināju echo "<a href='index.php?lang=en' ".(($lang == "en") ? "class='current'" : "")."><img src='misc/en_n.png'></a>"; un echo "<a href='index.php?lang=en' ".(($lang == "en") ? "class='current'" : "")."><img class='en' src='en_n.png'></a>"; tagad rādās bilde bet nekas cits nenotiek nemainās uz hover un current Quote Link to comment Share on other sites More sharing options...
Martiny Posted February 26, 2010 Report Share Posted February 26, 2010 Sveiks Ziedinj! Skatos, ka problēma ar vienkāršajām un dubultām pēdiņām. ' - lieto, ja jādrukā (jaizvada) teksts, kurā nav nepieciešams meklēt mainīgos utt. " - lieto, ja tekstā ievieto arī mainīgos, kurus nākas apstrādāt. Tavs links varētu strādāt, ja darīsi sekojoši: $forCssClass = ($lang == "en") ? "current" : ""; echo '<a href="index.php?lang=en class='.$forCssClass.'">Linkam paredzētais teksts vai bilde</a>'; Pārbaudi iznesu ārpusē, jo tur pārāk daudz simboli, kuri var ietekmēt A HREF un iespējams, ka pats apjuktu tos izvietojot norādē. Ceru, ka risinājums palīdzēs. Dod atsauksmi kā ir? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 26, 2010 Author Report Share Posted February 26, 2010 Paldies! PHP tagad izskatās šāds $languages = array('en','lv'); if (isset($_GET['lang']) && in_array($_GET['lang'],$languages)) { $_SESSION['lang'] = $_GET['lang']; } if (isset($_SESSION['lang']) && in_array($_SESSION['lang'], $languages)) { include 'lang/' . $_SESSION['lang'] . '.php'; } else { include 'lang/en.php'; } $forCssClass = ($lang == "en") ? "current" : ""; HMLT echo "<div id='lang'>"; echo '<a href="index.php?lang=en" class="'.$forCssClass.'"><img src="misc/en_n.png"></a>'; echo '<a href="index.php?lang=lv" class="'.$forCssClass.'"><img src="misc/lv_n.png"></a>'; echo "</div>"; CSS #lang{ width:100px height:50px; float:right; } #lang .en{ background-image:url(../misc/en_n.png); background-repeat:no-repeat; } #lang .en a{ background-image:url(../misc/en_n.png); background-repeat:no-repeat; } #lang .en a:hover{ background-image:url(../misc/en.png); background-repeat:no-repeat; } #lang .en a .current{ background-image:url(../misc/en.png) background-repeat:no-repeat; } Laikam kko neesmu sapratis, bet nu tagad ir tas pats kas bija, bilde rādās, funkcijas strādā. Tagad kad viņš ir parasta linka bilde tad rādās en_n.png un lv_n.png, bet kad hover un current tad vajadzētu lai ir en.png un lv.png. Kā to var panākt?? To es nevaru iebraukt vai tas ir iespējams bez javascripta? Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted February 26, 2010 Report Share Posted February 26, 2010 Kā tu tādu css definējumu izpīpēji? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 26, 2010 Author Report Share Posted February 26, 2010 es nez.. pēc savas domas meiģināju uztaisīt, bet nu nekā nesanāk tapēc vēršos pēc palīdzības! Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted February 26, 2010 Report Share Posted February 26, 2010 Šis #lang .en attieksies uz <anytag id="lang"><anytag class="en"></anytag></anytag> Tev kaut kas tāds ir? Šis #lang .en a un #lang .en a:hover uz <anytag id="lang"><anytag class="en"><a href=""></a></anytag></anytag> Tev ir? #lang .en a .current uz <anytag id="lang"><anytag class="en"><a href=""><anytag class="current"></anytag></a></anytag></anytag> Tev ir? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 26, 2010 Author Report Share Posted February 26, 2010 man ir šādi: <div id='lang'> <a href='index.php?lang=en'><img class='en' src='en_n.png'></a> </div> Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted February 26, 2010 Report Share Posted February 26, 2010 Un tas atbilst, kaut vienam ko es uzrakstīju? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 26, 2010 Author Report Share Posted February 26, 2010 (edited) nē, tieši tapēc jautāju palīdzību lai var uztaisīt.. man to visu vajag vienā Edited February 26, 2010 by ziedinjsh 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.