Sửa lỗi background bị giật khi swipe qua lại trên Ipad
Khanh is a full stack web developer with over 15 years of experience developing for the web
Search for a command to run...
Khanh is a full stack web developer with over 15 years of experience developing for the web
No comments yet. Be the first to comment.
Elevate your bus reservation experience (or even movie, theater, train, ship, plane tickets) with the React Bus Seat Map Picker – a sophisticated and meticulously crafted script designed exclusively for bus seat bookings. Engineered with strict TypeS...

In previous blog, I migrated all posts from my WordPress to Hashnode at https://blog.donamkhanh.com. Now I create a simple landing page for my main domain and hosted on Github Page. You can access at https://donamkhanh.com. In feature, I'm going to h...

I just finished migrating my blog from Wordpress (self hosted on DigitalOcean) to Hashnode. How did I migrate? I don't have too many articles on Wordpress but I don't like doing it manually so the first thing I did was look to see if there was an aut...

Dự án mình đang làm có yêu cầu sử dụng Azure Active Directory (AAD) để lưu trữ thông tin người dùng & xác thực đăng nhập các kiểu. Ngoài các trường thông tin cơ bản mà AAD hỗ trợ ra thì dự án mình cần lưu thêm 1 số thông tùy chọn khác cho người dùng....

Introduction This is a concise front-end application developed with Angular. You can create a beautiful form with drag and drop visualization. You can get inspiration from it to make a draggable form; at the same time, you can also modify it to suit ...

Hôm nay tìm ra & fix được lỗi rất chuối khi swipe trên Ipad thì background image có thuộc tính background-size: cover bị giật.
Lý do là background image không hiểu do vô tình hay cố ý bị nhét thêm thuộc tính: no-repeat vào. Theo như mô tả của W3shools thì giá trị cover của background-size là:
Scale the background image to be as large as possible so that the background area is completely covered by the background image. Some parts of the background image may not be in view within the background positioning area
Rõ ràng, nếu đã scale tới giá trị lớn nhất có thể của kích thước containner thì no-repeat không cần thiết nữa, thử bỏ nó đi và đúng là lỗi đã được fix thật :)
Cập nhật: sau khi test lại thì lỗi chính xác là do thuộc tính background-attachment: fixed gây ra. Hiện vẫn chưa biết giải quyết thế nào với trường hợp này, vì nếu bỏ "fixed" đi thì với page có nội dung dài thì background sẽ không scale được toàn bộ màn hình :(