Jump to content
php.lv forumi

Krāsu maiņa pārlādējot lapu


CGCX

Recommended Posts

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 :)

Link to comment
Share on other sites

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 by anonīms
Link to comment
Share on other sites

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 by mounkuls
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

: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;
}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...