Plugin Author
Joe
(@morehawes)
Hi Revived,
This is possible using JavaScript. I have put together a simple example of this here (please view source to see the code):
http://www.auctionnudge.com/temp/loading-example.html
The relevant JavaScript is:
<script type="text/javascript">
var an_container = document.getElementById('auction-nudge-items');
an_container.innerHTML = '<div id="loading">Loading content here...</div>';
</script>
Auction Nudge should load very quickly on your site, but may be slowed down by having to wait for other site assets to load first. I would recommend doing some page load optimisations and also enabling the Auction Nudge caching option (Settings > Auction Nudge > Use WordPress Cache?) to speed things up.
I hope this helps.
Joe
Should this js go in the head, after the opening body, or before the closing body?
Plugin Author
Joe
(@morehawes)
I believe it shouldn’t make a difference, as long as it goes before the Auction Nudge JavaScript which is just before the closing </body> tag.
Joe
I have it placed before the closing body and it seems to be working fine.
All I’m using is a loading animation (gif). It seems to be vertically aligning itself to the middle of the total height of the to be displayed listings. I realize this question is probably beyond the scope of your typical support but could you suggest a (I assume css) fix to force that loading image to the top of the div? I tried vertical-align: top but that’s not moving it up.
Plugin Author
Joe
(@morehawes)
On second thoughts, it’s probably best to place it somewhere after the <div id="auction-nudge-items" class="auction-nudge"></div> but before the Auction Nudge <script>.
The code I provided is just a quick and dirty example. I hope this helps though.
Joe
Disregard that css question. The image had a height of 800, that’s why! lol
Thanks!
I have it right after the function auction_nudge_loaded() script and before the closing body (with nothing else after) and it seems to be working fine.
Plugin Author
Joe
(@morehawes)
I have it right after the function auction_nudge_loaded() script and before the closing body (with nothing else after) and it seems to be working fine.
Great, I’m glad that worked.
Joe