HTML/JS Integration in Lectora

tmichael9734tmichael9734 Community Member Posts: 93
Hi Everyone,

I'm novice in JS and I'm trying to integrate this customized progress bar: https://www.w3schools.com/howto/howto_js_progressbar.asp into my Lectora title.  For two days now, I've been reading most of the articles on this topic, in forum and on the Internet, but to no avail.

Can anyone please describe for me in simple bullets how to do that?  I'm looking also for simple steps to use whenever I want to use JS in Lectora.

Many thanks,

Comments

  • wheelswheels Administrator Posts: 460 eLearning ROCKSTAR Admin Team
    Hi Therese @tmichael9734,

    I'm curious as to why you don't use the Progress Bar object that is part of Lectora?

    Thanks, - Joe
  • tmichael9734tmichael9734 Community Member Posts: 93
    Hi Joe,

    Thank you for your quick response.  I want to customize the Progress bar for 2 reasons:

    1- I need the percentage of completion for accessibility reasons.  AT users cannot see the bar when it advances but at least they can hear the remaining percentage.

    2- I really would love to learn how to integrate JS in Lectora, for some fun stuff.  People are saying that Lectora provides flexibility of using JS and HTML gadgets and creating more appealing and interactive courses, and I want to taste this experience myself.

    Thank you again,
  • wheelswheels Administrator Posts: 460 eLearning ROCKSTAR Admin Team
    Therese @tmichael9734

    Thank you for the explanation!

    There are many ways to do this, I decided to put all the code inside a HTML Extension as an example. You can then size the HTML Extension object as you would like and it will be the progress bar.

    I have attached my example as a Lectora Online Package file. It can be imported into either Lectora Online or Lectora Desktop.

    See if this helps you. There are many skilled developers in the forums, so I hope they post some other solutions, maybe with some more details :)

    Hope this helps.

    - Joe
  • tmichael9734tmichael9734 Community Member Posts: 93
    Perfect!!! Thanks a lot Joe! Let me try it and will come back to you :)

    Meanwhile, I'm open to all ideas from the forum pros!  One never stops learning and I'm learning from all of you!

    Many thanks again,
  • mnotermans5114mnotermans5114 Community Member Posts: 916
    One of the first things you need to know when starting with Javascript is the use of selectors. A 'selector' is a way to select part of a page. That can be an image, a text or anyother page-element. JQuery for example is a library originally designed to select page-elements easily.

    So when you are familiar with the most common Javascript selectors, both in plain javascript ( often called 'Vanilla Javascript' ) and using libraries like JQuery to select page-elements...you will need to combine that knowledge to select elements in Lectora.

    There is a big difference in selecting page-elements with javascript in Lectora Online and the desktop versions, so be quite aware of that...and always mention which Lectora version your working with when asking for Javascript help.

    Kind regards ,
    Math
  • mnotermans5114mnotermans5114 Community Member Posts: 916
    Although this is far from ready i uploaded some course i planned on Javascript in Lectora. Time and work prevented me from finishing it, but you might find some usefull tips in it...

    https://community.trivantis.com/shared-content/first-steps-in-javascript/
  • mnotermans5114mnotermans5114 Community Member Posts: 916
    And another unfinished but usefull part of that course...

    https://community.trivantis.com/shared-content/getting-started-with-javascript/
  • tmichael9734tmichael9734 Community Member Posts: 93
    Hi Math,

    Thanks a lot for the tips and the sample courses.  I'm sure they'll be very helpful for me, no matter finished or not:)  I'll look at them and will come back to you with questions if you don't mind.  BTW I'm using Lectora Inspire (the desktop version).

    Many thanks again and appreciate all your help and time.
  • tmichael9734tmichael9734 Community Member Posts: 93
    Sorry forgot to say; I'm using Lectora Inspire, V18.2

    Thanks,
Sign In or Register to comment.