Jump to content

[SOLVED] swapping the title image on button press


kev wood

Recommended Posts

i am loading page content into a div tag using javascript and php but the title section of the site is not held in the div.  so this means that i am left with th esame title on each page.

 

i thought i would be able to a similar image swap with it as is done with a roll-over but this has not worked. 

 

here is the code i have so far

 

the functions in the head

		function loadContent(id) {
		$("#contentArea").load("rpc.php?o="+id+"");
	}

	function roll(img_name, img_src)
   		{
   			document[img_name].src = img_src;
   }
   function click(img_name, img_src)
   {
   		document[img_name].src = img_src;
   }

 

and the code on the button is

 

<a href="javascript:loadContent(1);" onmouseover="roll('about_but', 'buttons/about_but2.png')" onmouseout="roll('about_but', 'buttons/about_but.png')" onmousedown="click('title_img', 'assets/homeP_title.png')" onmouseup="click('title_img', 'assets/aboutP_title.png')"><img src="buttons/about_but.png" name="about_but" border="0" align="left"/></a>[code]

any help would be much appreciated. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.