Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Modify JS

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #242982
    X1AN36B0
    Participant

    Hey guys,

    I’ve got this set up in which when you click anywhere on the canvas it reveals a new image. It’s pretty straightforward, just one image after the other.

    I’d like to change that behavior a little bit. I’d like to have multiple stacks of images and have where you click matter.

    It should behave like this: you start with a blank canvas just like now. when you click on the canvas for the first time it will reveal the 1st image of the 1st stack. from that point on if you click on an image you’ll get the next image from that stack while if you click on the canvas you’ll get the first image of next stack. I hope that wasn’t too confusing. :-)

    Basically, if you click the canvas you’ll get the stacks and if you click the images you’ll get more images from that stack.

    Is that too complicated?
    I’m a JS n00b. :-(

    Thank you all very much for your help.

    http://codepen.io/X1AN36B0/pen/KMMYZX

    #243014
    X1AN36B0
    Participant

    Nobody with some guidance? :-(

    #243110
    X1AN36B0
    Participant

    Looks like everybody’s gone on vacation… ✈️
    My timing sucks! 😢

    #243128
    Jerba
    Participant

    You’re not too far off what you’re trying to achieve…

    Pretty much all you need to do now is; define some sequences of images, perhaps just using arrays.

    Determine how the parameters of the click event impact the resulting sequence (maybe quadrants) and then any subsequent clicks simply get the next index in the array based on the amount of clicks since the sequence started and draw it to the screen.

    #243130
    X1AN36B0
    Participant

    Thanks for your advice Jerba. 👍

    I kinda see what you mean, but unfortunately I don’t think I have enough JS knowledge to pull it off myself. 😞 Would you be able to help me out?

    I forgot to mention this before, but I wouldn’t have only images. Some of the content would be text as well…

    #243260
    X1AN36B0
    Participant

    Nobody else?

    #243285
    Jerba
    Participant

    People aren’t going to simply write the functionality for you, if you need this desperately then you may need to employ someone to build it for you.

    Otherwise, I can help point you in the direction of some useful resources to help you build the basic functionality and improve your Javascript knowledge.

    Javascript Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript

    Javascript OOP Introduction: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript

    Event Listeners: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

    I hope this helps!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.