JeetSaru / Fly-To-Shopping-Cart-Animation-With-Vanilla-JavaScript-

When you click on 'Add to Cart' button product image will fly and drop into 🛒 shopping cart. This kind of fly to 🛒 shopping cart effect is mostly found in e-commerce website. So let's build this add to cart animation with pure | vanilla JavaScript.
5 stars 3 forks source link

Function getBoundingClientRect() has issue with Safari and iOS #1

Open andreasoikon opened 1 year ago

andreasoikon commented 1 year ago

Hello,

I am using your script on my eshop and it works great. The only problem is on iPhones.

Although on Android smartphones it works like a charm, on iPhones I believe there is an issue with getBoundingClientRect() function.

I also checked the browser compatibility here --> developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect and it seems like the Safari on iOS hasn't got a full compatibility. Currently (on 23/3/2023) there is an asterisk stating that we should check the implementation notes, whatever that means.

If you could help that would be awesome.

Thank you in advance, Andreas

JeetSaru commented 1 year ago

Hi,

Asterisk (*) represents Implementation Notes that means

Safari for iOS will modify the effective viewport based on the user zoom. This results in incorrect values whenever the user has zoomed.

Thank you! Jeet Saru

On Thu, Mar 23, 2023 at 3:47 AM Andreas Oikon @.***> wrote:

Hello,

I am using your script on my eshop and it works great. The only problem is on iPhones.

Although on Android smartphones it works like a charm, on iPhones I believe there is an issue with getBoundingClientRect() function.

I also checked the browser compatibility here --> developer.mozilla.org/docs/Web/API/Element/getBoundingClientRect https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect#browser_compatibility and it seems like the Safari on iOS hasn't got a full compatibility. Currently (on 23/3/2023) there is an asterisk stating that we should check the implementation notes, whatever that means.

If you could help that would be awesome.

Thank you in advance, Andreas

— Reply to this email directly, view it on GitHub https://github.com/JeetSaru/Fly-To-Shopping-Cart-Animation-With-Vanilla-JavaScript-/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMH2MJLBP7O7XO3RP2N7QT3W5QS3TANCNFSM6AAAAAAWFAQ3V4 . You are receiving this because you are subscribed to this thread.Message ID: <JeetSaru/Fly-To-Shopping-Cart-Animation-With-Vanilla-JavaScript-/issues/1 @github.com>