Finding Where You Used Objects/ Variables

benpitman
Community Member Posts: 763
Here's a BETTER solution.Every HTML page has an internal array of objects - in this instance we use the images array.The ONLY caveat here is that you have to publish with the alt tags ON, as Lectora retains the name that you gave the image when authoring in the alt tag.So, the process is to use the images array to identify the object you are looking for by comparing the name you use in the function (myImageName) to the alt name of the image in array. That yields the DIV name of the object. WHEW - (it would be easier if they just kept the authored name and checked for duplications when authoring OR publishing).Once the object/image has been identified it can be swapped out with the image of your choice!Here's the function at Ben - The field is small so some of the lines have been carried over to the next line. If you have trouble with this PM me.function checkForMyImage(nameOfImageWhenAuthored){for (i=0; i < document.images.length; i++) { var myAltName=(document.images.alt); var myImageName = (document.images.name); myDivName = myImageName.slice(0,((myImageName.length)-3)); if (myAltName.charAt(0)=='[') { var startNo = 1; } else { var startNo = 0; } var myAltName = nameOfImageWhenAuthored ? return myDivName : alert('image not found'); } }SBEdited By: SBelzer on 2006-4-17 7:58:6
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