VR Course Contest
Show us your best virtual reality course and win $50 gift card and a winner badge!
CHECK IT OUT
How to connect action with javascript?

mkia
Community Member Posts: 38
Hello, how can I attach an action to javascript in Lectora?
For example I would like a user to click on each step in accordion before showing next img or button. Or when they check out a carousel to have an img popping out for each step.
Help...:)
For example I would like a user to click on each step in accordion before showing next img or button. Or when they check out a carousel to have an img popping out for each step.
Help...:)
0
Comments
-
I'm not sure I understand what you are looking to do. Can you provide a sample of what you are working on and explain how you want it to function? Variables can be passed back and forth between JavaScript and Lectora.0
-
You can add an action to an item and then request that it run a javascript code. Is that what you mean?0
-
I attached the sample of what I'm working on...
I have the accordion and an img below, and I want img to be seen only after the user clicked on all fields in the accordion.
0 -
1. Create a variable in Lectora, e.g. "allsectionsseen"
2. Create an action group on Page 1 with one action
Action: Show
Target: Arrow_next
Condition: Only if
"allsectionsseen" contains "#accordion-1" AND
"allsectionsseen" contains "#accordion-2" AND
"allsectionsseen" contains "#accordion-3"
3. Edit "Externe HTML-Objekte Code"
Under the line "var currentAttrValue = jQuery(this).attr('href');"
add two lines of code:
Varallsectionsseen.set(Varallsectionsseen.getValue()+currentAttrValue);
runGroup_og99();
Replace og99 with the html name of the action group created under 2.
Tim0 -
ahhhhhh....
that's it...great!!! thank you!!!!!
0
Categories
- 4.4K All Categories
- 35 ✫ Announcements
- 6 ✪ Contests
- 34.1K eLearning Brothers® Products
- 97 Lectora®
- 1.1K Lectora Discussions
- 1.9K Lectora Feature Requests
- 53 Lectora User Groups
- 2 AssetLibrary™
- AssetLibrary Discussions
- 2 AssetLibrary Feature Requests
- 67 CenarioVR®
- 110 CenarioVR Discussions
- 77 CenarioVR Feature Requests
- 2 Rockstar Learning Platform®
- 1 Rockstar Learning Platform Discussions
- 1 Rockstar Learning Platform Feature Requests
- 4 Off-the-Shelf Course Library
- 3 Off-the-Shelf Course Library Discussions
- 1 Off-the-Shelf Course Library Feature Requests
- 1 CourseMill®
- 101 CourseMill Discussions
- ReviewLink®
- 21 ReviewLink Discussions
- 12 ReviewLink Suggestions
- 1 The Training Arcade®
- 1 The Training Arcade Discussions
- The Training Arcade Feature Requests
- 7 Additional Learning Products
- 2 Adobe®
- 2 Articulate®
- 1 Camtasia®
- Docebo®
- 1 iSpring®
- 1 Microsoft® PowerPoint®
- 292 All Things eLearning
- 3 Course Development Showcase
- 1 eLearning Brothers® Downloads
- 1 Compliance Training
- 4 eLearning Development
- eLearning Game Design
- 7 Instructional Design
- 266 Learning Management System (LMS) Integration
- 2 Mobile Learning
- 2 Visual Design
- 319 Web Accessibility
- 579 ♪ The Green Room
- 2 ♡ Community Feedback
- 6 Community Tips