Sandis Posted December 13, 2004 Report Share Posted December 13, 2004 (edited) Man webaa no DB izsviezh laukaa laukus-sadaljas, kuri satur gada skaitljus (..., 1999, 2000, 2001, ...) Kaa pareizi 'uztamboreet' kodinju JavaScriptaa, kas, nospiezhot konkreetu sadalju, atstaaj to boldaa!? Kods: for($i = 0; $i < $hmg; $i++){ if (isset($_REQUEST["g"])) { $bold='<b>'.$gal[$i][0].'</b>'; } else { $bold=$gal[$i][0]; } // pieskjiiru boldu - bet, logjiski, ka nospiezhot uz vienas sadaljas, tas boldaa paarveersh visas sadaljasb :) $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);">'.$bold.'</a><td>'; } Edited December 13, 2004 by Sandis Link to comment Share on other sites More sharing options...
Sandis Posted December 13, 2004 Author Report Share Posted December 13, 2004 Un itkaa to visu vajadzeetu atrisinaat ar onmouseclick..! Bet neiekraaso viss! :( for($i = 0; $i < $hmg; $i++){ if (isset($_REQUEST["g"])) { $bold='<b>'.$gal[$i][0].'</b>'; } else { $bold=$gal[$i][0]; } // pieskjiiru boldu - bet, logjiski, ka nospiezhot uz vienas sadaljas, tas boldaa paarveersh visas sadaljasb :) $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);" onmouseclick="Javascript: mon(this);" >'.$bold.'</a><td>'; } Link to comment Share on other sites More sharing options...
Sandis Posted December 14, 2004 Author Report Share Posted December 14, 2004 Risinaajums: ... $gal = $GLOBALS["gal"]; $ha = $_REQUEST["g"]; ... // ja galerijas masiiva elements == ar galerijas id ($ha jeb $_REQUEST["g"]), tad pieliek <b></b> tagus, citaadi - printee bez tiem (taatad - risinaajums bez JavaScripta, kaut gan likaas, ka bez taa neizdosies ieboldot sadalju) for($i = 0; $i < $hmg; $i++){ if ($gal[$i][0] == $gal[$ha-1][0] && $_REQUEST["g"]==$ha) { $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);"><b>'.$gal[$i][0].'</b></a><td>';} else{ $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);">'.$gal[$i][0].'</a><td>';} } Triviaala situaacija ar triviaalu risinaajumu, kaut gan pamatiigi ieberzos! :) Link to comment Share on other sites More sharing options...
Venom Posted December 14, 2004 Report Share Posted December 14, 2004 programmatoriski: if (isset($_REQUEST["g"])==$i) CSSsiski: a:active {font-weight:bold} Link to comment Share on other sites More sharing options...
Sandis Posted December 14, 2004 Author Report Share Posted December 14, 2004 Paldies, Venom, par padomu - aizdomaajos! :) Link to comment Share on other sites More sharing options...
Recommended Posts