Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Graphics Triggered by Event

Status
Not open for further replies.

sandra45

Technical User
Apr 3, 2003
72
0
0
ID
Hi, is it possible to load graphics/image triggered by an event? For instance, picture A will be embedded to an html page if an event happens. Can anybody inform me how to do this? Thanks.

Regards,
Sandra
 
Sure you can. Here is one example of how you might do this:

You might have a <div> on the page with style="display:none;" - which effectively prevents the display of anything inside that <div>. Assuming this <div> contains an <img> with an ID, then you could target the image, change the src value and then set the style of the <div> to be style="display:block;".

All this can be done using Javascript... and you could easily trigger this with events.

Post some details of what events you want to trigger on etc if you get stuck (or just want some advice).

Jeff
 
Hi Jeff, thanks for your reply. At this moment I haven't got an agreed idea on the event and how the image will be shown. It might be that when the user has sent registration to the database, it will be the event to trigger the loading of the image on the "other" page. Each registration will trigger each image loading. The image should be loaded on a specific location of that other page. Please let me know how to contact you once I have this idea formulated, I'll continue posting the question on this thread. Thanks.

Regards,
Sandra
 
Ahh... slight confusion over your use of the word event I think. Whilst you are using it correctly, the word has special meaning (in the javascript world).

Regardless, I believe you could still achieve your solution in much the same method you describe. Keep the thread live here... that way others can benefit from the solution too!

Here is a great description of Events and Event Handlers for javascript (I think it's a rather outdated document... but it's still relevant).


Cheers,
Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top