Javascript style fomatting affecting fadein javascript

On my page here I'm trying to change the width of the list items (in the middle, containing images) under ul class="bxslider".

The javascript to change the width and margin is:

<script type="text/javascript">
  $(document).ready(function(){

$('.bxslider').bxSlider({
  minSlides: 3,
  maxSlides: 4,
  slideWidth: 170,
  slideMargin: 10
});
  });
</script>

Open in new window


Every time I change the margin e.g. from 10 to 15, the fadein javascript for the images doesn't work, whether it's placed before or after the bxslider javascript.

I just need to edit the bxslider CSS and javascript without affecting the fadein javascript.

The html and javascript for the homepage is:

<h2>Featured Brentwood Restaurants</h2>
<ul class="bxslider">
  <li><a href="/brentwood/restaurants/chinese-restaurants/mizu-brentwood-402.html"><img alt="Mizu Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/mizu.jpg" /><div><h3>Mizu</h3><span>Chinese Restaurants</span></div></a></li>
  <li><a href="/brentwood/restaurants/fine-dining/masons-restaurant-brentwood-458.html"><img alt="Masons Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/masons.jpg" /><div><h3>Masons</h3><span>Fine Dining</span></div></a></li>
  <li><a href="/brentwood/restaurants/gastropubs/nags-head-399.html"><img alt="Nags Head Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/nags-head.jpg" /><div><h3>Nags Head</h3><span>Gastro Pubs</span></div></a></li>
  <li><a href="/brentwood/restaurants/indian-restaurants/rajmoni-indian-restaurant-485.html"><img alt="Rajmoni Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/rajmoni.jpg" /><div><h3>Rajmoni</h3><span>Indian Restaurants</span></div></a></li>
  <li><a href="/brentwood/restaurants/fine-dining/smiths-restaurant-456.html"><img alt="Smiths Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/smiths.jpg" /><div><h3>Smiths Restaurant</h3><span>Fine Dining</span></div></a></li>
</ul>


<h2>Featured Brentwood Hair and Beauty</h2>
<ul class="bxslider">
  <li><a href="/brentwood/hair-and-beauty/beauty-salons-and-spas/the-beauty-studio-brentwood-481.html"><img alt="Beatuy Studio Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/beauty-studio.jpg" /><div><h3>The Beauty Studio</h3><span>Beauty Salons</span></div></a></li>
  <li><a href="/brentwood/hair-and-beauty/beauty-salons-and-spas/tres-chic-beauty-572.html"><img alt="Tres Chic Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/johannas.jpg" /><div><h3>Tres Chic Beauty</h3><span>Beauty Salons</span></div></a></li>
  <li><a href="/brentwood/hair-and-beauty/hairdressers/vicky-newman-hair-and-make-up-583.html"><img alt="Vicky Newman Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/vickynewman.jpg" /><div><h3>Vicky Newman Hair<br />&amp; Makeup</h3><span>Beauty Salons</span></div></a></li>
  <li><a href="/brentwood/hair-and-beauty/beauty-salons-and-spas/inula-beauty-571.html"><img alt="Inula Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/inula.jpg" /><div><h3>Inula Beauty</h3><span>Beauty Salons</span></div></a></li>
</ul>


<h2>Featured Brentwood Shopping</h2>
<ul class="bxslider">
  <li><a href="/brentwood/shops-and-shopping/farm-shops/frenches-farm-organic-butchers-shop-588.html"><img alt="Frenches farm Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/frenchesfarm.jpg" /><div><h3>Frenches Farm Shop</h3><span>Farm Shops</span></div></a></li>
  <li><a href="/brentwood/shops-and-shopping/florists/chris-evans-fleur-decor-433.html"><img alt="Chris Evans Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/chris-evans.jpg" /><div><h3>Chris Evans Fleur Decor</h3><span>Florists</span></div></a></li>
  <li><a href="/brentwood/shops-and-shopping/shoe-shops/candy-says-vintage-clothing-556.html"><img alt="Candy Says Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/candysays.jpg" /><div><h3>Candy Says Vintage</h3><span>Clothes Shops</span></div></a></li>
  <li><a href="/brentwood/shops-and-shopping/furniture-shops/tides-home-and-garden-587.html"><img alt="Tides Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/tides.jpg" /><div><h3>Tides Home &amp; Garden</h3><span>Furniture</span></div></a></li>
</ul>


<h2>Featured Brentwood Tradesmen</h2>
<ul class="bxslider">
  <li><a href="/brentwood/tradesmen/bathrooms-and-kitchens/vision-interiors-404.html"><img alt="Vision Interiors Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/vision.jpg" /><div><h3>Vision Interiors</h3><span>Bathrooms and Kitchens</span></div></a></li>
  <li><a href="/brentwood/tradesmen/plumbers-and-central-heating/timmins-property-services-411.html"><img alt="Timmins Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/timmins.jpg" /><div><h3>Timmins Property Services</h3><span>Plumbers</span></div></a></li>
  <li><a href="/brentwood/tradesmen/locksmiths/kat-master-locksmiths-468.html"><img alt="KAT Locksmiths Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/kat.jpg" /><div><h3>KAT Master Locksmiths</h3><span>Locksmiths</span></div></a></li>
  <li><a href="/brentwood/tradesmen/builders-and-bricklayers/allied-group-403.html"><img alt="Allied Group Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/allied.jpg" /><div><h3>Allied Group</h3><span>Builders and Bricklayers</span></div></a></li>
</ul>


<h2>Featured Brentwood Bars and Pubs</h2>
<ul class="bxslider">
  <li><a href="/brentwood/pubs-and-bars/bars/lot-75-cafe-bar-412.html"><img alt="Lot 75 Cafe Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/lot75.jpg" /><div><h3>Lot 75</h3><span>Bars</span></div></a></li>
  <li><a href="/brentwood/restaurants/gastropubs/the-greyhound-brentwood-487.html"><img alt="The Greyhound Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/greyhound.jpg" /><div><h3>The Greyhound</h3><span>Pubs</span></div></a></li>
  <li><a href="/brentwood/nightlife/bars/the-teriss-bar-565.html"><img alt="Teriss Bar Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/teriss.jpg" /><div><h3>The Teriss Bar</h3><span>Bars</span></div></a></li>
  <li><a href="/brentwood/nightlife/pubs/horse-and-groom-593.html"><img alt="Horse and Groom Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/horsegroom.jpg" /><div><h3>The Horse &amp; Groom</h3><span>Pubs</span></div></a></li>
  <li><a href="/brentwood/restaurants/gastropubs/the-tower-arms-484.html"><img alt="Tower Arms Brentwood" class="lazy" src="/images/grey.gif" data-original="/images/featured/tower-arms.jpg" /><div><h3>Tower Arms</h3><span>Pubs</span></div></a></li>
</ul>

<br />

<div class="main_section clearfix">
   <div class="item">
     <a href="/<%=lcase(Session("PublicFranchiseName"))%>/business-directory/index.html" title="View <%=Session("PublicFranchiseName")%> Business Directory">
       <img class="lazy" alt="View Business Directory" src="/images/grey.gif" data-original="/images/home/directory_section.jpg" />
       <span class="main_h3"><span class="arrow_right"></span>
       Business Directory</span>
     </a>
   </div>

   <div class="item last">
     <a href="/<%=lcase(Session("PublicFranchiseName"))%>/events/index.html" title="View <%=Session("PublicFranchiseName")%> Events">
       <img class="lazy" alt="View Events" src="/images/grey.gif" data-original="/images/home/events_section.jpg" />
       <span class="main_h3"><span class="arrow_right"></span>
       Events</span>
     </a>
   </div>
</div>

<div class="main_section clearfix">
   <div class="item">
     <a href="/<%=lcase(Session("PublicFranchiseName"))%>/news/index.html" title="View <%=Session("PublicFranchiseName")%> News">
       <img class="lazy" alt="View News" src="/images/grey.gif" data-original="/images/home/news_section.jpg" />
       <span class="main_h3"><span class="arrow_right"></span>
       Local News</span>
     </a>
   </div>

   <div class="item last">
     <a href="/<%=lcase(Session("PublicFranchiseName"))%>/pages/advertise.html" title="Advertise to <%=Session("PublicFranchiseName")%>">
       <img class="lazy" alt="Advertise" src="/images/grey.gif" data-original="/images/home/advertise_section.jpg" />
       <span class="main_h3"><span class="arrow_right"></span>
       Advertise</span>
     </a>
   </div>
</div>

<script type="text/javascript">
  $("img.lazy").lazyload({
    effect: "fadeIn"
  });   
</script>

<script type="text/javascript">
$("img.lazy").show().lazyload();  
</script>

<script type="text/javascript">
  $(document).ready(function(){
    
$('.bxslider').bxSlider({
  minSlides: 3,
  maxSlides: 4,
  slideWidth: 170,
  slideMargin: 10
});
  });
</script>

Open in new window




Any help appreciated.
UName10Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

duncanb7Commented:
Did you take a look those callback  function for bxslider  at
https://github.com/wandoledzep/bxslider-4 
for onSliderload ,before, after to include fadein function.

and check those example from bxslider.com
http://bxslider.com/examples



Callbacks

onSliderLoad Executes immediately after the slider is fully loaded

default: function(){}
options: function(currentIndex){ // your code here }
arguments:
  currentIndex: element index of the current slide
onSlideBefore Executes immediately before each slide transition.

default: function(){}
options: function($slideElement, oldIndex, newIndex){ // your code here }
arguments:
  $slideElement: jQuery element of the destination element
  oldIndex: element index of the previous slide (before the transition)
  newIndex: element index of the destination slide (after the transition)
onSlideAfter Executes immediately after each slide transition. Function argument is the current slide element (when transition completes).

default: function(){}
options: function($slideElement, oldIndex, newIndex){ // your code here }
arguments:
  $slideElement: jQuery element of the destination element
  oldIndex: element index of the previous slide (before the transition)
  newIndex: element index of the destination slide (after the transition)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
UName10Author Commented:
Thanks for this and sorry for the delay - bit behind!

I#ll check it out and come back, thanks.
0
UName10Author Commented:
Sorry - I'm not allowed to ask questions so I'll have to accept answers now as it's saying these are abandoned which they are not.
0
UName10Author Commented:
This question was not abandoned
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.