matthewp / position--sticky-

Polyfill for position: sticky;
175 stars 34 forks source link

Support cross-domain stylesheets #7

Closed AlecRust closed 9 years ago

AlecRust commented 11 years ago

From my testing a stylesheet that sits on a separate domain from sticky.js will cause the polyfill to fail (in the case of a CDN for example). Is there a way around this? Respond.js's solution to this may provide some inspiration.

matthewp commented 11 years ago

Yeah, that sounds doable. I'm not sure when I'll be able to get around to it though. Do you want to take a crack at it? I'll add you to the contributors of this project.

turadg commented 11 years ago

Fwiw, when I ran into this I configured my S3 bucket for CORS.

matthewp commented 11 years ago

@turadg CORS doesn't work in IE < 10 though. Not sure what browser support we are shooting for here.

AlecRust commented 11 years ago

What browser support does the polyfill have regardless of cross-domain? Might be worth documenting that in the README too.

Thanks for the push access, I'll give it a try when I've got time.

AlecRust commented 11 years ago

This also doesn't seem to work if the stylesheet and sticky.js are on the same domain but external, i.e.

<link rel="stylesheet" href="http://cdn.website.com/css/main.css"> <script src="http://cdn.website.com/js/sticky.js"></script>

I don't know if that's easier to account for or not.