Jump to content

How to stop bxslider images from stacking up before Welcome page fully loads


zaromnia

Recommended Posts

Hi, I've included a bxslider on the "Welcome to our store" page. However the images from the slider show stacked before the page fully loads. What would be the easiest way to stop them showing until the page/slider is fully loaded. I'm fairly new to this coding thing so step by step help would be much appreciated. Thanks

Link to comment
Share on other sites

Okay, so I initially followed BSmither's advice on how to add a bxslider by simply pasting code into the Foundation "Welcome to our store" page and that added the bxslider. That's it. I've checked out the link above, but  I have no idea where to paste this:

 

$(document).ready(function(){ $('.mySlider').show().bxSlider({ slideWidth: 160, minSlides: 2, maxSlides: 5, preloadImages: 'all' }); });

 

Sorry I'm so stoopid but I have no excuse...:lol:

Link to comment
Share on other sites

Having followed my instruction to add a specific instance of the BXSlider into the Homepage document, you may have this:

In admin, Documents, click the Edit icon for the document identified as the homepage document.

On the Content tab, switch to Source mode.

Find something similar to:
<ul class="bxslider_homepage">

Change this by adding only the style="display:none;" part:
<ul class="bxslider_homepage" style="display:none;">

Find something similar to:
$(window).load(function(){ $('.bxslider_homepage').bxSlider({auto:true,captions:true}); });

Change this by adding only the .show() part:
$(window).load(function(){ $('.bxslider_homepage').show().bxSlider({auto:true,captions:true}); });

We initially tell the browser to suppress showing the list of images. After the window loads, the BXSlider functionality is triggered, which converts the list to a slider.

But, since the images for the slider are not shown, the added show() is used to make them visible then instantly converted to a slider.

Link to comment
Share on other sites

  • 2 weeks later...

This is what my browser has for the HTML sent:

<ul banner1.png="" class="bxslider_homepage" style="display:none;">
	<li><img src="images/homebxslider/Banner1.png"/></li>
	<li><img src="images/homebxslider/Banner2.png"/></li>
	<li><img src="images/homebxslider/Banner3.png" title="" /></li>
</ul>

The 'banner1.png' attribute shouldn't be there, but probably isn't causing any damage.

I also see this:

$(document).foundation({equalizer:{equalize_on_stack:true}});
$('.bxslider_homepage').show().bxSlider({auto:true,captions:true}) .show().bxSlider({auto:true,captions:true});
$('.chzn-select').chosen({width:"100%",search_contains:true});

The second line has too much code, although I do not know if this is the problem. That line should be:

$('.bxslider_homepage').show().bxSlider({auto:true,captions:true});

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...