joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

how to remove epubs default stylesheet(Alignment) and apply alignment dynamically. #193

Closed nirmaala closed 11 years ago

nirmaala commented 11 years ago

Hi,

I am using monocle to load ePub. When any ePub is loaded its default css file Which is placed inside ePub folder (OPS/CSS folder ) is loaded.In my Phonegap based App , I have a button for alignment . When I tap on this button, it will change text alignment .To implement this , I am using following function:

reader.addPageStyles("body { " +"text-align:center;"

I found another function

reader.formatting.updatePageStyles( reader.formatting.properties.initialStyles, 'body { text-align:center; }', true );

But again, its not solving my problem. Please help me.

nirmaala commented 11 years ago

Please help me.

nirmaala commented 11 years ago

Fixed issue. I had to add tags in which alignment was applied as:

reader.addPageStyles("div, h1, h2, h3, h4, h5, p{ " +"text-align:right!important;"