How to show the image using the External Javascript code?

vinothcse123 Community Member Posts: 11

I am currently using the show action in lectora online to show the image (Show->Image).

But There are about 50 images in my Title.

Calling that images one by one using the show action in Lectora is really time consuming for me.

Can any body suggest ideas to call the images imported in lectora using the javascrit.

Thanks in advance.


  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 569 eLearning ROCKSTAR Admin Team
    Could you put the image objects in a group object and then call show/hide once on the group objects?

    Another idea is to use the layering ability, put all the images to the back of the layers. Then put a text block with the same background color as your background over the top of the images. Then you can hide the text block to show the images.

    You can also do a javascript solution but it becomes more involved. If you can post an example title package here I will look at it.

    Thanks for using Lectora Online!!!
  • vinothcse123
    vinothcse123 Community Member Posts: 11
    Thank u so much for the reply...

    My concern is not that.

    First of all i need clarification with your reply.

    I understand your statement "put the image objects in a group object" as creating the group for showing the images. Is my understanding is correct?

    I don't how my issue will be solved by creating the group.

    In your second paragraph you have told to create the text block with same background of the images?

    I dont know how it will help me to show the images one by one.

    Here am lisiting my needs in bullets,

    1. There will be sequence of images for me up to 50.

    2.I need to save time by calling javascript instead of using the show action.

    3.The images will be diplayed sequentially one by one.

    4.For each image there will be one audio

    5.The next image will be shown after the audio of the 1st image over. This will happen up to 50 times.

    So there will be 50 images and 50 audio for me. which will run one by one.

    4. For eg When am showing the 35th image, 35 th image's audio will be played. After the successfull completion of 35 audio 36 image and audio will be played. similarly for all next sequence of images

    5.Suggest me any javascript ideas. It will be more helpfull for me.
  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 569 eLearning ROCKSTAR Admin Team
    Hi, I don't understand how it's so difficult in Lectora Online. I have attached a very simple title that has six images and six audio files, it works like a slideshow showing an image playing an audio file, then continuing on. Once you have the basic actions it's so easy to just copy and update them. Please take a look and tell me what the pain points are for you. You can implement a javascript solution but it's harder to maintain by someone else too.

    ( to get the example title download the attachment and remove the .zip extension, then import the title into Lectora Online )

    Thank you for starting this thread.
  • vinothcse123
    vinothcse123 Community Member Posts: 11
    Thank you so much for your contribution.

    I have reviewed your attachment.

    You have used about two actions for each slide show. That is change content action and play audio action.

    It is very easy to show the slide show for 10 images. we can cut and copy the actions and we can use it.

    What the real situation for me is I have to create about 200 titles in which i have to show slide show in each and every title. Every title will contain about 50 different images. My volume is too high. so about 200*50*2 action i have to give to complete my task.

    The solution you provided is too good. But it will take huge time for me to complete the task.

    In this case when i use the external javascript code then all images will be put in a loop. it will be called one by one. I no need to call each and every image. I have solution in javascript for this. But the only difficult i am facing is i cannot refer the image i have imported. I have to open each and every image i have imported to see the image name. Is there is any way to refer the images i have imported to Lectora other than the image name.
  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 569 eLearning ROCKSTAR Admin Team
    If you can post an example title, or the script you want to use I can see if I can help.

    First thoughts are to import all the images and put them into a group, set the group to not initially visible (hidden), then use javascript to get all the IMG tags and iterate over them to get the src attribute.

    var imgs = document.getElementsByTagName('IMG');

    for (var i=0;i

    var imageFile = imgs.src;

Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!