changing image on page when button is pressed

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Feb 2008
Posts: 347
Reputation: kevin wood is an unknown quantity at this point 
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz

changing image on page when button is pressed

 
0
  #1
Mar 20th, 2009
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>
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 347
Reputation: kevin wood is an unknown quantity at this point 
Solved Threads: 1
kevin wood's Avatar
kevin wood kevin wood is offline Offline
Posting Whiz

Re: changing image on page when button is pressed

 
0
  #2
Mar 20th, 2009
it was a spelling mistake stopping
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC