builtbywill / booklet

jQuery Plugin - display web content in a flipbook
http://builtbywill.com/booklet
Other
291 stars 109 forks source link

IE8 invalid property while turnover a page #39

Open tdeuling opened 10 years ago

tdeuling commented 10 years ago

The IE8 throws an invalid property while turnover a page.

After inspecting the script, it turns out the the following lines: https://github.com/builtbywill/Booklet/blob/master/booklet/jquery.booklet.latest.js#L480

will be execute several times, so that the initial value 166 becomes for example ---166pxpxpx. The IE8 doesnt like this and throws an error.

Here's a quick fix for that problem:

// save shadow widths for anim
if(options.shadows) {

    var tempShadowFwdWidth = parseInt(options.shadowTopFwdWidth, 10);
    if(tempShadowFwdWidth>=0) tempShadowFwdWidth=tempShadowFwdWidth*-1;
    options.shadowTopFwdWidth = String(tempShadowFwdWidth) + 'px';

    var tempShadowBackWidth = parseInt(options.shadowTopBackWidth, 10);
    if(tempShadowBackWidth>=0) tempShadowBackWidth=tempShadowBackWidth*-1;
    options.shadowTopBackWidth = String(tempShadowBackWidth) + 'px';

    //options.shadowTopFwdWidth = '-' + options.shadowTopFwdWidth + 'px';
    //options.shadowTopBackWidth = '-' + options.shadowTopBackWidth + 'px';
}