Closed bleedweedsuz closed 6 years ago
i saw your answer from epub.js i modified this https://github.com/geek1011/ePubViewer/blob/5b4d4990350d0548a7634b7a4d95aa0f39e262ab/script.js#L408-L461 to this for my app my question is i have to call this function from every time chapter changes what should i do? do i have to call all the time page changes or i m missing something?
let rules = { "body": { "background": "#888888", "color": "#525252" }, "p": { "font-family": "Aerial", "font-size": "12px", }, "a": { "color": "inherit !important", "text-decoration": "none !important", "-webkit-text-fill-color": "inherit !important" }, "a:link": { "color": "#909090", "text-decoration": "none !important", "-webkit-text-fill-color": "#909090" }, "a:link:hover": { "background": "rgba(0, 0, 0, 0.1) !important" }, "img": { "max-width": "100% !important" }, }; if(this.Rendition){ this.Rendition.getContents().forEach(c => c.addStylesheetRules(rules)); }
Oh! i found your other code Rendition.hooks.content.register(this.ChangeThemeFunction.bind(this)); this fix my problem
Rendition.hooks.content.register(this.ChangeThemeFunction.bind(this));
Yep. You need to call it:
i saw your answer from epub.js i modified this https://github.com/geek1011/ePubViewer/blob/5b4d4990350d0548a7634b7a4d95aa0f39e262ab/script.js#L408-L461 to this for my app my question is i have to call this function from every time chapter changes what should i do? do i have to call all the time page changes or i m missing something?