Expand/Collapse content by clicking the Title/Caption
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 118
- Joined: Mon Apr 19, 2010 5:33 pm
Expand/Collapse content by clicking the Title/Caption
Is there a built-in way by which we can extend the wh_expand_btn functionality to include clicking the titles? For example, it's much easier to be able to click a section title to expose content than to click the 18x16 expand button.
-
- Posts: 118
- Joined: Mon Apr 19, 2010 5:33 pm
Re: Expand/Collapse content by clicking the Title/Caption
For anyone interested, I managed a solution with jquery.
This goes in the document.ready function
This goes in the document.ready function
Code: Select all
// ========== EXPANDABLE/COLLAPSIBLE TITLES
// Creates a new class (clickableTitle) for the parent of each .wh_expand_btn found.
// See the related function in the Functions section below.
$("span.wh_expand_btn").each(function() {
console.log("found expand btn");
var createId = $(this).parent().text();
var newId = createId.replace(/\s+/g, '');
$(this).parent()
.css('cursor','pointer')
.addClass('clickableTitle')
// add an ID of the title text minus spaces
.attr('id',newId)
;
});
// ========== END EXPANDABLE/COLLAPSIBLE TITLES
Code: Select all
// "Clicks" the element with the wh_expand_btn class
$(document).on('click', '.clickableTitle', function () {
var clickedItem = $(this).attr('id');
console.log('you clicked ' + clickedItem);
$(this).find('.wh_expand_btn:first').click();
});
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service