How you said one option is to place a preloader while the image is loading.
If you cannot touch so deep with JavaScript and PHP I have one simple sugestion which I think will work for you.
<div class="image-preloader">
<img src="https://wordpress.stackexchange.com/questions/129186/yourimage.jpg" alt="" />
</div>
Create a wrapper (holder) around your image.
With CSS put the preloader as a background on the HOLDER DIV.
.image-preloader {
background('images/loader.gif') 50% 50%;
}
Like that while the image is loading you will have your preloader and when the Image is loaded it will be hidden under it.
Related Posts:
- Adding HTML within an image title attribute
- Landing Page with HTML CSS JS and Images on wordpress
- Parallax image problem
- xajax expanding list query
- Set timeout for ajax (jQuery)
- Refresh/reload the content in Div using jquery/ajax
- How to reference a theme image in a stylesheet?
- Making WordPress Gallery (.gallery-item) Responsive?
- Width 100%: Aspect ratio of image
- Add CSS class to every image
- alt, title tags not showing
- How to Make WordPress Default gallery responsive on mobile?
- Responsive background images added inline
- @wordpress/create-block image url in css
- How do I remove generated HTML around images in posts?
- Why html tags are being appended to my pictures?
- How to resolve – IE 6 ignores img “width” properties
- How can I upload an image for background use using the Theme Editor in WordPress?
- Trying to create a mouseover effect in html using Gutenberg editor
- Override img class in gallery
- How can I insert an image map into a WordPress blog post?
- AJAX – save an $_FILES picture in media library
- Images will not display, when I call them up with html in wordpress, just two blank small spaces [closed]
- How to fix “.webp” being auto-added to the end of image urls
- Get image URL after image created from canvas and sent to WP uploads with AJAX
- Multiple amp-image overlays. How to properly do this in wordpress?
- Image not shown in the theme as it’s showing in HTML template [closed]
- How can I use cached images in an AJAX response?
- Changing default img html markup but not in admin back-end?
- How to handle a background-size: cover image in WordPress?
- Background-image not showing? [closed]
- Help to upload post attachments from Ajax
- How to implement secure frontend image upload? [closed]
- t5-fresh-editor-stylesheets.php breaks image placement in WP Beta 3 editor
- Modifying the HTML Output of Inserted Images
- How do I get my main image to stretch the full length of the screen?
- Rewrite inline image markup
- How to upload and style svg logo?
- Images under 1MB are not being compressed
- How would you add sequentially numbered labels to images in posts?
- css to fit image by HEIGHT
- Can’t add image to site via php
- Adding srcset to an image in ajax
- How to implement CSS-defined images from bootstrap site in wordpress theme
- a: hover issue with image issues [closed]
- All 3?: Responsive resizing of images + image width of actual image for small images + max-width for all larger images
- Moving an image to the side [closed]
- What exactly is the description field when uploading an image?
- Image Captions Have a 10px Extra Margin, And It’s Not CSS? [duplicate]
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- HTML Img with data:image src gets sanitized in admin?
- Displaying images outside the content
- Image modification
- How to remove image size inline style in article and include caption
- Is there a layout to place 2 same sized images in two columns on the WordPress page?
- How to change background image
- Change header image size
- Adding custom html/css/images to Theme
- Is there a way to create referable automatic numbering in image captions?
- Why do images inserted in the post content via the_content() go off the max-width?
- How can we achieve this image css style?
- Remove image border in twentyeleven theme [closed]
- How to include different html tags in the header for different pages?
- How to link to img src using HTML email template in WordPress
- How to display posts with images in fullscreen slider
- Using a full-width hero image that can be changed in the dashboard by a user
- Relative path not working at all in WAMP local environment
- Put image onto header
- Are WP images responsive by default?
- Image thumbnail on single product issue | WooCommerce
- What is the best way to handle Ajax image upload on front end?
- Background image call problem
- all images of past post messed up after changing theme
- Custom styling Insert Media window
- An image on my site is showing as the wrong image [closed]
- Theme files and imagesnot loading on a mobile device
- Garbled HTML pulled for page description “caption id=attachment…”
- Imagem resolution responsive
- Is there a good way to use CMS images with CSS
- Forcing absolute src links in the RSS feed
- where is images/image.jpg?
- change with CSS the color of an svg background image set with “background-image: url()”
- Issues with the excerpt (wordcount/HTML/images)
- Stop underlining image links
- Font size on image captions on mobile
- Hover images and Videos
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- Why is inline CSS added to images automatically? [closed]
- Add a background image into a post [closed]
- Create decorative image border with CSS? [closed]
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- Placing a background image with text over it
- WordPress update leads to 404 error on admin page and signup. CSS mishap with all plugin related functions
- I am having trouble displaying an image at the top of a widget area [closed]
- Gutenberg block HTML image rendering override
- Is there a way to add background-image to theme.json?
- Regex expression for redirecting image URLs to another folder
- Skewed / slanted button within elementor [closed]
- fitting the thumbnail image into a div
- WP_Query not returning results