943,974 Members | Top Members by Rank

Ad:
Mar 20th, 2009
0

changing image on page when button is pressed

Expand Post »
i have built a page which loads content into a div tag from a php page using javascript.

the problem i am having is that the title for eachg page is not inside the div so i keep being left with the same title on each page.

i have tried to change the image using the onmouseup/down functions but this has not worked.

here is the code for the functions

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. function loadContent(id) {
  2. $("#contentArea").load("rpc.php?o="+id+"");
  3. }
  4.  
  5. function roll(img_name, img_src)
  6. {
  7. document[img_name].src = img_src;
  8. }
  9. function click(img_name, img_src)
  10. {
  11. document[img_name].src = img_src;
  12. }

here is the code for the button

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <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>
Reputation Points: 27
Solved Threads: 1
Posting Whiz
kevin wood is offline Offline
347 posts
since Feb 2008
Mar 20th, 2009
0

Re: changing image on page when button is pressed

it was a spelling mistake stopping
Reputation Points: 27
Solved Threads: 1
Posting Whiz
kevin wood is offline Offline
347 posts
since Feb 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Slideshow Issue - uses JavaScript
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Trying to figure out how to load/reload div?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC