| | |
image swap
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
i am trying to write a function so that when a user enters onto a page selected images change with each page that is entered. the page uses an iframe to load the new data so i need to swap the images on the main page which holds the iframe inside it.
in the body of the page
would the code look something like the code above or would it need to be expanded because the images that are being change are not in the iframe.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
function swap_image{ document['imgMain'].src = title_commissioning.jpg; }
in the body of the page
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
onload="swap_image"
would the code look something like the code above or would it need to be expanded because the images that are being change are not in the iframe.
i ahve changed the code but it still is not working the code i have now looks like this
in the body tag
and were the image is displayed
i will kep looking for the solution if i find it i will post it. if anyone knows were to find the solution please post the address here.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
function changeImage() { if (document.getElementById) { document.getElementById("image").style.background="images/home_title.jpg"; } else if (document.all) { document.all["image"].style.background="images/home_title.jpg"; } else if (document.layers) { document.layers["image"].style.background="images/home_title.jpg"; } }
in the body tag
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
onload="changeImage()"
and were the image is displayed
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<td height="24" colspan="2" id="image" background="images/commissioning_title.jpg"></td>
i will kep looking for the solution if i find it i will post it. if anyone knows were to find the solution please post the address here.
![]() |
Similar Threads
- Javascript image swap on rollover. (JavaScript / DHTML / AJAX)
- A new image swap? (JavaScript / DHTML / AJAX)
- Image Swap Problems (JavaScript / DHTML / AJAX)
- Image Swap help (HTML and CSS)
- Image swap behaviour from Dreamweaver no longer works once uploaded (Site Layout and Usability)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: opacity problem inside setTimeout() for IE
- Next Thread: Trying to use swap Images with two separate Images
Views: 1717 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxcode ajaxhelp animate array automatically autoplay beta boarder box bug button calendar captcha card cart codes column cookies createrange() css cursor date debugger decimal design developer dom download dropdown element enter error events firefox firehose flash focus form frameworks getselection google gwt html htmlform iframe image() index java javascript javascripts jawascriptruntimeerror jquery jsp listbox maps marquee masterpage menu microsoft mimic mp3 mp4 offline onmouseover parameters php player post problem programming progressbar prototype rating redirect regex safari scale scriptlets search select size sources sql starrating text textarea toggle twitter validation variables w3c web website window windowofwords windowsxp xml xspf





