Jump to content
php.lv forumi
  • 0

Javascipt link un bildes maina


Question

Posted

Sveiki, tatad javascipt strada ja

href=''#''

, bet ja ir kaut kads links tad backgrounds nomainas atpakal. Ka lai uztaisa lai uz linka ari butu nomainijies tas background.

  <a class="leftstyle" onclick="changeStyleBig(this)" href="?action=Galerijas&bildetagad=1">Kompozīcijas traukā</a>

 

un javascipt

 

function changecolorza(el,off){
 document.getElementById('wrapper').style.background= "url(bildes/bk/zalais_bkg.png) no-repeat";
}

3 answers to this question

Recommended Posts

  • 0
Posted

Vakar pilnā biju - nekā nesapratu, tagad itkā dzērumu izgulēju, bet tāpat nevaru "iebraukt"...

Diezgan nesakarīgi noformulēts pieprasijums.

 

Ar onClick izsauc vienu funkciju, a ar JS uzrādi pavisam kautko citu :/

Ko tad Tu īsti gribi panākt ?

  • 0
Posted (edited)

Es gribētu panākt, lai uzspiežot uz kāda linka(vienalga kura) background-image nomainās, tuklāt paliek arī tad, ja es pēc tam spiežu uz citiem linkiem tajā pašā lapā. Vai tas vispār ir iespējams?

 

edit: bildes maina paredzeta nevis pasham linkam, bet gan BODY

Edited by Sephy

Join the conversation

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

Guest
Answer this question...

×   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...