JS - Gettings the parent html name of the object which I assigned an action to

dcarlier
Community Member Posts: 1
Hi,
First of all, thanks for taking the time to read this post.
I'm trying to create an animation option for lectora objects, first step is to make a list of the objects that i want to animate. My idea was to assign an action to an image in lectora.
That action is running a:
Show->GoTo->Webpage->javascript:getImageName(parameter)
I want to send along a parameter that contains the name of the image it is assigned upon.
Example hierarchy:
- Image4
= Action1
So Action1 will run something like getImageName(what is the parent? it is Image4).
Does anyone know how to retrieve the html name of its' parent in an action?
Thanks in advance!
David
First of all, thanks for taking the time to read this post.
I'm trying to create an animation option for lectora objects, first step is to make a list of the objects that i want to animate. My idea was to assign an action to an image in lectora.
That action is running a:
Show->GoTo->Webpage->javascript:getImageName(parameter)
I want to send along a parameter that contains the name of the image it is assigned upon.
Example hierarchy:
- Image4
= Action1
So Action1 will run something like getImageName(what is the parent? it is Image4).
Does anyone know how to retrieve the html name of its' parent in an action?
Thanks in advance!
David
Comments
-
wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 685 eLearning ROCKSTAR Admin TeamHi,
Not sure if this will help, but here are a few basics, which you might already know....
You can view object's html names in their properties dialogs. To turn this on you need to click the preferences (the gears) on the File Tab. Then click the option to Show HTML published object names in object properties.
Now if you look in the properties of Image 4 it might have HTML Name: image49
For images if you want to get to the IMG tag then you would reference it in the DOM by image49.dCon
It would be quite a bit harder to identify the parent of the action in JavaScript dynamically.
There is another thread that shows how to set your name for the object to be the JavaScript name for the object:
http://lectora.com/forum/showthread.php?t=12911
Hope this helps! -
I think this will help, http://stackoverflow.com/questions/403967/how-may-i-reference-the-script-tag-that-loaded-the-currently-executing-script, if you're able to apply the principle to Lectora native objects, like Images. I've successfully used this technique recently on External HTML Objects.
Categories
- 35.9K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 29K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 25 ELB Learning Content
- 25 ELB Learning Content Discussions
- 329 CenarioVR®
- 196 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 42 Rockstar Learning Platform®
- 39 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 936 All Things eLearning
- 37 eLearning Development
- 546 Learning Management System (LMS) Integration
- 333 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products