× Discussion about Hot Effects Slider Joomla module.

Topic-icon Hot Effects Rotator Loading Problem

More
7 years 10 months ago - 7 years 10 months ago #1711 by nathan@xacommerce.com
When the Hot Effects Rotator is loading on my page, it displays a strange, unwanted side effect that has all of the images on top of one another, improperly displayed in the image below.



My client has continued to ask how we can prevent this, since it does it across all major platforms and browsers.

Do you have any ideas how to clean this up?

Thanks in advance,
-nathan
Last edit: 7 years 10 months ago by nathan@xacommerce.com.

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #1712 by milos
You can try to preload images that you are using in the rotator. Please copy this code above the </head> in your template's index.php file:
<script type="text/javascript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
</script>
Change <body> tag in the same file, and list all the images for preloading:
<body onload="MM_preloadImages('http://www.yoursite.com/images/imagename.jpg','http://www.yoursite.com/images/imagename2.jpg')">

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #1713 by nathan@xacommerce.com
If I add this code, wouldn't it force these images to preload for every page on my website? I'm only using the H.E.R. on the frontpage.

Is there a way to have this work only for the homepage?

Thanks.

Please Log in or Create an account to join the conversation.

More
7 years 10 months ago #1714 by milos
Once loaded, the images would be stored in visitor's cache, so they won't be loaded from server every time. Anyway, if you want preload to happen only on the home page, and assuming you are using Frontpage component for the home page, please change code in <body> with:
<body <?php if (@$_REQUEST['view'] == 'frontpage') { ?>onload="MM_preloadImages('http://www.yoursite.com/images/imagename.jpg','http://www.yoursite.com/images/imagename2.jpg')"<?php } ?>>

Please Log in or Create an account to join the conversation.

More
7 years 6 days ago #7968 by nathan@xacommerce.com
And what's the easiest way to edit the header/body tags in Joomla?

Will I need to add both as you mentioned above or just <body tag change?


Thanks for your help with this.

Please Log in or Create an account to join the conversation.

More
7 years 5 days ago #7974 by ivan.milic
Go to Template Manager -> <your template> -> Edit HTML

You need to edit them both because change in body tag actually calls the function that is defined in that script block.

Please Log in or Create an account to join the conversation.

Time to create page: 0.128 seconds