We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Get Event Property (target.id)

Home Forums Puzzles Get Event Property (target.id)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #10094
    johngrigni
    Customer

    I have a list of icons with their own ids in a parent doc that should be clickable to apply various textures. But there are over 40 of them which means that the icons run off the page with a little scroll bar in their own div.

    I’m trying to save myself a lot of repetitive work by making a list of the id’s that can be pressed in one big ‘On Event of (click)’ puzzle, then using that id as a variable to pull a matching bit of data from a CSV. Since they are in a scrollable div, the pageY isn’t useful, but I thought I could use Get Event Property (target.id) but that doesn’t seem to generate anything. Am I mis-understand what that is or should that work?

    Or should I add a script to the parent doc that sends that info, and if so how would that work? Bear in mind I am not a programmer by any stretch.

    #10105

    Hi,

    Can you print to the console the output of the target.id puzzle and see if it actually produces the ids of those icons? Or add a temporary text object to your scene and update it with the output.

    Chief 3D Verger | LinkedIn | Twitter

    #10108
    johngrigni
    Customer

    I had it updating the inner html of an element on the parent doc, it just came out blank. PageX and pageY updated correctly, but target.id just made it blank.

    #10116

    Can you share an example project? Or email it my way. Thanks!

    Chief 3D Verger | LinkedIn | Twitter

    #10174

    Hi again,

    Sorry for the delay. It appears that the HTML elements ids are not assigned – that’s why target.id returns blank id. The ids are assigned to list elements instead.

    You can re-assign ids to your buttons with HTML code as follows:

    Now it is:
    <li class='finishes' id='FINAfricanCherry'><div class='icons' style="background-image:url('iconFIN/AFRICAN_CHERRY.jpg')">African Cherry</div></li>

    Should be:
    <li class='finishes'><div id='FINAfricanCherry' class='icons' style="background-image:url('iconFIN/AFRICAN_CHERRY.jpg')">African Cherry</div></li>

    Chief 3D Verger | LinkedIn | Twitter

    #10175

    Regarding the other question, the camera looks down because its target is set to the look at the origin. You can modify the target coordinates on this panel:

    Attachments:
    You must be logged in to view attached files.

    Chief 3D Verger | LinkedIn | Twitter

    #10180
    johngrigni
    Customer

    Thank you! As always you come through for me!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.