HOME ➔ SUPPORT ➔ Community ➔ CourseLab Objects ... how hide ou show a image or a simple object with javascript in courselab 2.4 ?
how hide ou show a image or a simple object with javascript in courselab 2.4 ?
  View type:
Hi
I try document.getElementById('IMG_1').style.display = 'hidden';
but it don't work....
I knows with the action display.

thanks for your help !
sorry for my english !!
Thread is freezed
 
When you drop an image onto the page it is copied into the main comtent folder and given a random identifier, well not random but different to the original name.
It will also have an identifier that is used on page and is unique in the module. If you put an image on page one and then copy it to the next page it will rename ans save that object again.
Look at what the name for the object courselab is using.
The JS also needs to be declared in the head section of the page, now if you look at how courselab is rendered in a browser you'll see that adding this inline in a javascript object isn't going to work.
You would need to add this into the general javascript folder as a function and then call it from the javascript object.
You seem to be trying to reinvent the wheel when a perfectly functional and scriptable method already exists that does work.
Why???
Thread is freezed