•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,219 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,277 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 615 | Replies: 3 | 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.
function swap_image{
document['imgMain'].src = title_commissioning.jpg;
}in the body of the page
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.
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
onload="changeImage()"
and were the image is displayed
<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.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
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: Hide/Show html forms using javascript


Linear Mode