www.webdeveloper.com
Results 1 to 8 of 8

Thread: Intercept event on an image JS has put itself

Threaded View

  1. #1
    Join Date
    Mar 2012
    Location
    France
    Posts
    23

    Intercept event on an image JS has put itself

    Hi,

    Then, my kingdom game with rats in JS is on the road. I even started to make it have "turns". Work well (thanks again for the innerHTML solution, guys).

    Actually, to wait between turns, i'm using an "alert box". But i want something else.

    What i'm wanting is :

    - The script put an image "next turn" on the page, with a createElement.
    => work well, the image appear.

    Then i put a loop for the turns.
    => work well too. You can choose starting turn, ending turn, increment, and if there is a turn "0" (when starting is negative and ending positive, by example. You know year 0 didn't exist, of course).


    My problem is now :

    How do my script can intercept an event (a click will do) on a image it put itself in the page ?

    Of course, i searched for explanations and tutorials, but those i found speak of an "onclick" on the image calling a new JS script, and i don't know if trading data between scripts is even possible.

    An idea ?
    Last edited by Ddurand; 04-09-2012 at 06:30 AM. Reason: spelling

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles