Jump to content
php.lv forumi

Jautajums ar moveover, move back


BOJA

Recommended Posts

function moveover(){

document.getElementById('hom').src="images/home.png";

document.getElementById('new').src="images/news.png";

document.getElementById('down').src="images/downloads.png";

document.getElementById('acc').src="images/account.png";

}

function moveback()

{

document.getElementById('hom').src="btn_home.png";

document.getElementById('new').src="btn_news.png";

document.getElementById('down').src="btn_downloads.png";

document.getElementById('acc').src="btn_account.png";

}

 

 

kad uzbraucu uz kadu no shiem imagiem man paradas parejiem imagies kkas liidziigs :/

Kaa var atdaliit katru no augshaa mineetaam funkcijam?

Link to comment
Share on other sites

Ja gribi ar inline onmouseover taisīt, tad veido tās fjas apt. šādi:

 

<script>
function change_src(element, img_name) {
element.src = img_name;
} 
</script>

<img onmouseover="change_src(this, 'attels_kuru_radit.png');" onmouseout="change_src(this, 'attels_kuru_radit.png');" />

 

PS. Protams, var arī šādi:

<img onmouseover="this.src = 'attels_kuru_radit.png';" onmouseout="this.src = 'attels_kuru_radit.png';" />

Bet es ieteiktu vispār neizmantot inline eventus - http://www.google.lv/search?hl=lv&q=un...sive+javascript

Edited by andrisp
Link to comment
Share on other sites

×
×
  • Create New...