Jump to content
php.lv forumi

Vai to var ar php...


tiy

Recommended Posts

Vai to var ar php html un css izdarit datu fichu

 

ir bildes (piem.Suns Kakis)

 

Ar peli uzbrauc uz bildes, kur ir suns un text arena blakus paradas apraksts par suni.

 

 

============== -----------------------------------------

=_______________=

=_______________=

=Suna bilde______ = _________Text_____________

= _______________=

= _______________=

============== --------------------------------------------

 

 

kad pele nav neuzkadas bildes neko neizvada

 

varbut var ari bez php es nezinu tapec jau jautaju, es 100% zinu ka to var izdarit ar JS, bet JS daudziem useriem medz but islegts, ko tad?

Edited by tiy
Link to comment
Share on other sites

Bet ja uzraksta php veida ar html formu, un bilde ir ka poga un, kad ta ir nospiesta subit aizsuta uz php scriptu id=suns datu baze iesercho suns="suns dzivnieks ar chetram kajam ....",tad aizuta uz text arenu sho rindu, ta var izdarit.

Edited by tiy
Link to comment
Share on other sites

tiy-->

cit:

Ar peli uzbrauc uz bildes,

//un

bilde ir ka poga un, kad ta ir nospiesta

/cit:

Noformulee savu jautaajumu preciizaak

PHP izpildaas tikai uz servera !

ja taa bilde ir kaa links, tad var iztikt ar tiiru HTML

ja kaa poga tad bez JS nekaadi...

Link to comment
Share on other sites

Ta ir bilde, bet nav linka. Kads tad var palidzet ar JS to dabut gatavu.

Bet shitais it ka strada, bet vinsh to izvadishanu veic cita lapa, es gribu, lai vina notiek ta ja pasha lapple un kaut vai ieksh table.

 

<script type="text/javascript">

function izvada_datus(id)

{

if (id==1){ document.write("Suns")}

if (id==2){ document.write("Kakis")}

}

</script>

 

<form>

<input type="image" src="xxx.jpg" onclick="izvada_datus(1)">

</form>

Link to comment
Share on other sites

HTML:

 

<html>
 <head></head>
 <body>
<script type='text/javascript'>
  var text=new Array();
  text['xxx']="teksts teksts teksts teksts teksts teksts teksts teksts teksts teksts teksts teksts";
  text['yyy']="kautkāds teksts kautkāds teksts kautkāds teksts kautkāds teksts kautkāds teksts";
  text['zzz']="parasts teksts parasts teksts parasts teksts parasts teksts parasts teksts parasts teksts";
  function showtext(what)
  {
	document.getElementById(what).innerHTML=text[what];
  }
  function hidetext(what)
  {
  document.getElementById(what).innerHTML="";
  }
</script>
<table border='1'>
  <tr><td><img src='xxx.jpg' onmouseover="showtext('xxx')" style='width:10px;height:10px;' onmouseout="hidetext('xxx')"/></td><td style='valign:top;' id='xxx'></td></tr>
  <tr><td><img src='yyy.jpg' onmouseover="showtext('yyy')" style='width:10px;height:10px;' onmouseout="hidetext('yyy')"/></td><td style='valign:top;' id='yyy'></td></tr>
  <tr><td><img src='zzz.jpg' onmouseover="showtext('zzz')" style='width:10px;height:10px;' onmouseout="hidetext('zzz')"/></td><td style='valign:top;' id='zzz'></td></tr>
</body>
</html>

 

ejoš piemers

Edited by [Ya]
Link to comment
Share on other sites

<html>
<body>
<table width="100%" cellpadding="10" border="0">
<td width="50%"><img src="suns.jpg" onMouseOver="document.getElementById('sunsapraksts').style.display='block';" onMouseOut="document.getElementById('sunsapraksts').style.display='none';"/><br/>
<img src="kakis.jpg" onMouseOver="document.getElementById('kakisapraksts').style.display='block';" onMouseOut="document.getElementById('kakisapraksts').style.display='none';"/><br/>
</td><td width="50%"><div id="sunsapraksts" style="display: none;">suns ir brūns</div>
<div id="kakisapraksts" style="display: none;">kaķis it smirdīgs</div>
</td></table>
</body>
</html>

kaut kam tādam vajadzētu iet..

Edited by php_Stopp
Link to comment
Share on other sites

ja tikai 2 elementi tad to tachu var arii visu izsariit ar:

---------

document.getElementById("id1").style.display = "block";

document.getElementById("id2").style.display = "none";

---------

protams jaustaisa pietiekami normaala f-ja utt...

---

ja vairaak tad

sakumaa visi elementi (no masiva) none

un vajadziigais block

 

pele nost -> visi none

edit:

php_Stopp pasteidzaas...

Edited by Grey_Wolf
Link to comment
Share on other sites

×
×
  • Create New...