- Posts: 8
- Thank you received: 0
Hot Effects Rotator Loading Problem
-
nathan@xacommerce.com
Inactive member - Topic Author
- New Member
Less
More
14 years 6 months ago - 4 years 5 months ago #1711
by nathan@xacommerce.com
Hot Effects Rotator Loading Problem was created 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
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: 4 years 5 months ago by milos.
Please Log in to join the conversation.
-
milos
Support Staff - Moderator
Less
More
- Posts: 6769
- Thank you received: 719
14 years 6 months ago #1712
by milos
Replied by milos on topic Re: Hot Effects Rotator Loading Problem
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:
Change <body> tag in the same file, and list all the images for preloading:
Code:
<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>
Code:
<body onload="MM_preloadImages('http://www.yoursite.com/images/imagename.jpg','http://www.yoursite.com/images/imagename2.jpg')">
Please Log in to join the conversation.
-
nathan@xacommerce.com
Inactive member - Topic Author
- New Member
Less
More
- Posts: 8
- Thank you received: 0
14 years 6 months ago #1713
by nathan@xacommerce.com
Replied by nathan@xacommerce.com on topic Re: Hot Effects Rotator Loading Problem
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.
Is there a way to have this work only for the homepage?
Thanks.
Please Log in to join the conversation.
-
milos
Support Staff - Moderator
Less
More
- Posts: 6769
- Thank you received: 719
14 years 6 months ago #1714
by milos
Replied by milos on topic Re: Hot Effects Rotator Loading Problem
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:
Code:
<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 to join the conversation.
-
nathan@xacommerce.com
Inactive member - Topic Author
- New Member
Less
More
- Posts: 8
- Thank you received: 0
13 years 8 months ago #7968
by nathan@xacommerce.com
Replied by nathan@xacommerce.com on topic Re: Hot Effects Rotator Loading Problem
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.
Will I need to add both as you mentioned above or just <body tag change?
Thanks for your help with this.
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
13 years 8 months ago #7974
by ivan.milic
Replied by ivan.milic on topic Re: Hot Effects Rotator Loading Problem
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.
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 to join the conversation.
Time to create page: 0.180 seconds