Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Strange bug seen only (so far) on Apple machines

Featured Replies

Hey guys!

 

I've been working on the front end of a site for a client and I'm getting a really weird bug when some of the pages are loaded on Apple machines - the bug is not present on Windows based machines.

 

The bug is apparent on some of the modules on the pages that contain them such as:

URL: http://wasabiadmin.se/global-business-labs-front-end/archive-find-us/

 

Where the read more button is incorrectly placed over the text, however when the page is refreshed it looks normal.

 

I am using an equal heights script I created to ensure the modules remain the same height as one another if the content in them differs. - Perhaps it is something to do with that?

 

 

Code for the equal heights script:

// calculate equal heights for modules
    function setMouleHeights(modules) {
        if (modules.length) {
            modules.css('height', 'auto');
            var maxHeight = 0;
            var modulePadding = modules.css('padding-bottom');
            var modulePadding = (parseInt(modulePadding, 10));
            modules.each(function() {
                if ($(this).height() > maxHeight) {
                    maxHeight = $(this).height();
                }
            });
            modules.css('height', maxHeight + modulePadding);
        }
    }

    setMouleHeights($('.location-module'));
    setMouleHeights($('.map-module'));
    setMouleHeights($('.case-module'));

    $(window).resize(function(){
        setMouleHeights($('.location-module'));
        setMouleHeights($('.employee-module'));
        setMouleHeights($('.case-module'));
    });

 

Thanks for any help in advance!

I only get the problem with Mac>Safari (Mac>Chrome is fine). That suggests something Safari specific, could be the JS or CSS.

 

Suggest disabling the javascript and see what difference that makes. If it clears the problem you'll know it's that, if not it could be the CSS that needs tweaking to accomodate quirks in Safari.

  • Author

Think i've found the problem - the function is called one the document.ready function.

 

Document.ready is fired even if images are still downloading -So here the height is calculated before the image has been fetched and the resulting height is incorrect. Need to look for a method that will determine once all the documents images are loaded and then call the set height function.

  • Author

Fixed! I put the initial function call statements in the $(window).load() method which only fires once everything in the document has loaded including images.

 

Thanks for the help 'BlueDreamer' and pointing me to the Js where the error was :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.