Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm new to this theme and I'm loving it so far!
One little issue:
On the first load of my site (in any browser), the slideshow doesn't load correctly (screenshots attached). All the divs appear on top of each other, and no slider is loaded. This problem is fixed upon refresh. How can I fix this so the slideshow loads first time?
Thanks,
John
Comments
Comment #1
Corbey CreditAttribution: Corbey commentedOops, forgot 2nd screenshot
Comment #2
Corbey CreditAttribution: Corbey commentedI've tried moving the slideshow to a system block, fiddled with the .info file order, done a complete reinstall - nothing seems to fix it.
If anyone can help out I'd massively appreciate it! Ideally I want to launch the site tomorrow and don't want to have to change theme.
Comment #3
gtsopour CreditAttribution: gtsopour commentedComment #4
gtsopour CreditAttribution: gtsopour commentedHello Corbey,
I will examine you issue. Please give me some time.
Thanks
/George
Comment #5
Corbey CreditAttribution: Corbey commentedThanks so much! I've postponed the site launch so please don't feel rushed.
Comment #6
Corbey CreditAttribution: Corbey commentedHi,
Any update on this?
Comment #7
gtsopour CreditAttribution: gtsopour commentedHello Corbey,
This issue (on first load or on page refresh) appears because the slideshow has not an initial fixed height. The slideshow's height determined dynamically by the height of each slider item. This is the default behaviour. Therefore, until the slideshow initialization, you can see all the slider items with their images one below the other.
Corbey, I will suggest you have 2 workarounds for this issue.
1. Define the initial height of slideshow and then let the slideshow to obtain the height of each slider item dynamically.
With this practise, you will define the initial (first) height of slideshow and then the slideshow will work as now. There is not a specific height that you should define, but the initial height should be relative to the height of your first slider item. One normal height for all cases is 300px for example. This is also a good initial height for default CorporateClean's slideshow for example.
Therefore, you should define the initial height inside template.php file (sites/all/themes/corporateclean/template.php) before after:onAfter attribute. The onAfter function calculates and finally defines the height of slideshow based on the height of each slider item
Change from
To
2. Define the initial height and comment the onAfter function in order to achieve a specific slideshow height.
With this practise the slideshow object knows his height by default and there is no need to calculate the slider item's height. You should comment the option after: and add the option height: with your desired height inside the teplate.php file. Your "desired" height must be the greatest of all heights of each slider item. This practise is an already closed (fixed) issue here http://drupal.org/node/1330298
Change from
To
You can see all the JQuery Cycle plugin options here http://jquery.malsup.com/cycle/options.html.
Thanks
/George
Comment #8
gtsopour CreditAttribution: gtsopour commentedCorbey inform me if you need further assistance.
Thanks
/George
Comment #9
Corbey CreditAttribution: Corbey commentedHi George,
I was getting really confused when testing these fixes for different browsers. Took me a while to figure it out but I found the problem in the end. Basically the above fixes work perfectly
BUT:
When a user loads the site and is not logged in to the site, the slideshow works perfectly first time in all browsers.
When a user loads the site and is logged in from the last visit, the slideshow error still occurs in all browsers (even with the above fixes implemented).
My site is an intranet and most people won't be logging out between visits so this is still an issue for me.
Can you help?
Comment #10
Corbey CreditAttribution: Corbey commentedAnother update:
I just realised this only happens with the admin account. All other users will see the slideshow as intended on first load with your fix (I used no.1 from #7). I'm not sure why it only happens with the admin account - could be a conflict with the administration menu? (from what I can see, that's the only difference between logging in as a user and logging in as admin. Then again, I'm a newbie..)
I'm the only admin for the site and only I will see the bug so, as far as I'm concerned, this is fixed. Thanks for your help on this - much appreciated & keep up the good work!
John
Comment #12
gtsopour CreditAttribution: gtsopour commentedCommitted and will be included into next Corporate Clean release:
1. Define the initial height of slideshow and then let the slideshow to obtain the height of each slider item dynamically.
Thanks
/George