Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

border styles not removed in IE8 #10

Closed
Runeform opened this issue Jun 11, 2014 · 8 comments
Closed

border styles not removed in IE8 #10

Runeform opened this issue Jun 11, 2014 · 8 comments

Comments

@Runeform
Copy link

hey there. first off, i love the script. the row aware feature is amazing especially for responsive sites.

i am having a strange issue however. in IE8 i am getting the following inline styles on my matchHeight elements.

border-top: medium none;
border-bottom: medium none;

it seems .css("border-bottom",""); is not doing its job in IE8 for some reason. I will look into it, but just wanted to let you know.

@liabru
Copy link
Owner

liabru commented Jun 11, 2014

Thanks. The script doesn't use any .css("border-bottom","");, so do you mean e.g. $that.css({ 'display': '' }); isn't working in IE8?

I've tested the demo again in IE8 (emulation mode), but it seems to be fine, could this only be in the real IE8 browser only? Could it be a jQuery version issue?

@Runeform
Copy link
Author

yes. specifically i meant this part.

// revert the temporary forced style
$elements.css({
'display': '',
'padding-top': '',
'padding-bottom': '',
'border-top': '',
'border-bottom': '',
'height': ''
});

BTW, looks fine to me, but you know how IE8 is...
tested the demo page straight from download in IE8 on a VM and im still getting the issue.

i also tested in IE9 and was able to reproduce the issue when using IE8 "document mode". IE8 "browser mode" did not reproduce.

i have included a screenshot. i guess we can rule out jquery version issue, as i was using your full package with its version of jquery.
Please let me know if there is any other info you need an thanks again for all the awesome work.

screen shot 2014-06-11 at 3 45 28 pm

@liabru
Copy link
Owner

liabru commented Jun 12, 2014

Ok so, turns out that there's specifically bugs with that approach in < IE8:
http:https://stackoverflow.com/questions/4036857/jquery-remove-style-added-with-css-function

@Runeform for now, I think you should modify your copy to use the .removeAttr('style'); approach?

I still need to think if that is appropriate to roll into the plugin myself though, since I'd rather not just remove the whole inline style attribute (in case other plugins are using it).

@Runeform
Copy link
Author

wouldnt that remove the height that matchHeight places on the object? or does all that happen before the height is applied?

@liabru
Copy link
Owner

liabru commented Jun 12, 2014

Yep that happens before the height is applied (see these lines), so should be fine.

That part of the code is preparation for finding rows.

@Runeform
Copy link
Author

actually i just found a work around

        // must first force an arbitrary equal height so floating elements break evenly
        $elements.css({
            'display': 'block',
            'padding-top': '0',
            'padding-bottom': '0',
            'border-top-width': '0',
            'border-bottom-width': '0',
            'height': '100px'
        });

        // get the array of rows (based on element top position)
        rows = _rows($elements);

        // revert the temporary forced style
        $elements.css({
            'display': '',
            'padding-top': '',
            'padding-bottom': '',
            'border-top-width': '',
            'border-bottom-width': '',
            'height': ''
        });

since its not setting the additional properties of "border" it does leave the border style and color behind and removes successfully

@Runeform
Copy link
Author

*it does 'not' leave...

@liabru
Copy link
Owner

liabru commented Jun 12, 2014

Ah, looks like that might do the trick. I'll try that out and push it if it works, thanks.

EDIT: tested working fine, cheers

@liabru liabru closed this as completed in 246820d Jun 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants