setFragment

fun setFragment(chapter: Int, fragment: String)(source)

Makes fragment the fragment of chapter's URL, as a viewer does when the reader goes to a place in the chapter through a link, the table of contents or a bookmark (#550). The element it names becomes the chapter's target. A chapter whose style sheets use :target is laid out again, and chapterChanges moves; any other chapter keeps its pages. A script session takes the new fragment the next time EpubScriptHandler.chapterOpened runs for the chapter, and its scripts get popstate and hashchange then. Lays out the chapter.