readium/r2-navigator-swift

second page word hi-lighter is not working in landscape

singhranakumar22gmailcom opened this issue · 1 comments

i am using readium library for epub and i am trying with javascript to select the word by it's text-id . In landscape it's working fine for 1st page but for second page it's not working. i am using changeTextColor(fragmentId: String) function for hi-lighter , in this function fragmentId printing correctly for second page also, but text is not getting hi-lighted.

func changeTextColor(fragmentId: String) {
          print(fragmentId)
       let scc = "document.getElementById('\(fragmentId)').style.color='#EA4343'; setTimeout(function(){ document.getElementById('\(fragmentId)').style.color = \"#000000\";}, 1500);"
       
       let script = "spread.eval('', \"\(scc.replacingOccurrences(of: "\"", with: "\\\""))\");"

        webView.evaluateJavaScript(script, completionHandler: nil)
}

Please create a new issue following the bug report issue template.