CGCX Posted January 2, 2010 Report Share Posted January 2, 2010 Sveiki kāds lūdzu nevar pateikt kā izveidot krāsu nomaiņu pēc lapas pārlādes? Nepieciešams navigācijai piemeram ieejam saitā navigacija ir zaļa * pārlādējot lapu tā nomainas uz zilu pectam uz sarkanu..* Jau iepriekš paldies :) Quote Link to comment Share on other sites More sharing options...
anonīms Posted January 2, 2010 Report Share Posted January 2, 2010 (edited) Es laikam veidotu tā, ka sametu arrayā krāsu kodus un id, teiksim $krasas = array('1'=>'#ff0000','2'=>'$0000ff','3'>'#ccc'); un tad ar rand fju katru reizi ģenerētu skaitli no 1-3 (vai nu cik tev tur viņus vajag) un tad vnk apvienoju to skaitli $krasas[$random_skaitlis] Edited January 2, 2010 by anonīms Quote Link to comment Share on other sites More sharing options...
CGCX Posted January 2, 2010 Author Report Share Posted January 2, 2010 jam bet ka lai es to dabuju ieksa style.css failiņā? Quote Link to comment Share on other sites More sharing options...
mounkuls Posted January 3, 2010 Report Share Posted January 3, 2010 (edited) jam bet ka lai es to dabuju ieksa style.css failiņā? CSS apraksti 3 klases katrai krāsu savu un viss. Lapā jau ar php maini to klasi uz kādu krāsu gribi. Vai arī sataisi trīs css failus un lapā maini href uz css Edited January 3, 2010 by mounkuls Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted January 3, 2010 Report Share Posted January 3, 2010 jam bet ka lai es to dabuju ieksa style.css failiņā? CSS nav obligati jaglaba atseviskaa failaa !!! vienkarshi ieliec starp <style> tagiem un viss Taa kaa gri mainit lapas fonu tad style tagus izvadi PIRMS body taga .. i visa problema..nav javeido Ntas klases etc. Quote Link to comment Share on other sites More sharing options...
CGCX Posted January 3, 2010 Author Report Share Posted January 3, 2010 :D nu man tada lieta ka Navigacijas dati atrodas css failiņā #altlinkler{ margin: 0px auto; text-align: center; font-size: 9px; font-weight: bold; height:28px; float:left; background-image:url(media/LUK Šeit atrodas fails...); background-repeat:repeat-x; background-position:top left; width:100%; } #altlinkler ul, #altlinkler li{ padding:0px; margin:0px; list-style-type:none; } #altlinkler ul{ height:28px; line-height:29px; background-image:url(media/nav_space.jpg); background-position:right; background-repeat:no-repeat; float:left; padding:0px 1px 0px 0px; margin:0px 0px 0px 10px; } #altlinkler li{ height:28px; line-height:29px; display:inline; position:relative; float:left; width:82px; text-align:center; } #altlinkler li a{ height:28px; width:82px; text-align:center; float:left; background-image:url(media/nav_space.jpg); background-position:left; background-repeat:no-repeat; } #altlinkler li a:link, #altlinkler li a:visited{ color:#fff; text-decoration:none; } #altlinkler li.active a, #altlinkler li a:hover{ background-image:url(media/nav_active.png); background-repeat:no-repeat; background-position:left; } Quote Link to comment Share on other sites More sharing options...
biezpiens Posted January 3, 2010 Report Share Posted January 3, 2010 Var darīt kā teica anonīms un listam pielikt vienkārši krāsu <ul style="color:<?php echo $krasas[$random_skaitlis]; ?>;"> ... Quote Link to comment Share on other sites More sharing options...
mounkuls Posted January 3, 2010 Report Share Posted January 3, 2010 By Grey Wolf: CSS nav obligati jaglaba atseviskaa failaa !!!vienkarshi ieliec starp <style> tagiem un viss Taa kaa gri mainit lapas fonu tad style tagus izvadi PIRMS body taga .. i visa problema..nav javeido Ntas klases etc. Labi, ka Tev na darīšana ar WAP, bez sāls apēstu par šito:D Bet webam jā, protams tā var. 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.