Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Alex Sims
3,636 PointsWMU Slider Problem
Hey guys,
I've noticed some strange behavior whilst using the WMU slider on a site I am building in conjunction with the Twitter Bootstrap framework.
Whenever I refresh the page the slider will occasionally not load but my pagination tabs and the "previous and next" text will show. After concurrent refreshes my slider will display as desired, does anyone have any idea as to why this may be happening?
Here is some of my markup...
-- Footer.php snippet --
<script src="javascript/jquery.js"></script>
<script src="javascript/bootstrap.js"></script>
<script type="text/javascript" src="javascript/jquery.wmuSlider.min.js"></script>
<script>$('.wmuSlider').wmuSlider();</script>
-- index.php snippet --
<div class="container wmuSlider">
<div class="wmuSliderWrapper row-fluid">
<article class="span12">
<div class="span7">
<br/>
<h1 class="push-right">LOW TORQUE. HIGH VALUE.</h1>
<hr>
<p class="large-quote">We think you'll love our Plug Valves, they are created solely in the US and are of the best quality, why not check them out?</p>
<p class="push-right-down"><a href="swivels.php" class="btn btn-danger btn-large"> Plug Valves </a></p>
</div>
<div class="span5 slider-image">
<img src="images/slider/plugvalve-slider.jpg"/>
</div>
</article>
</div>
</div>
-- header.php snippet --
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>FlowValve Home</title>
<link rel="stylesheet" type="text/css" href="style/bootstrap.css" media="screen">
<link rel="stylesheet" type="text/css" href="style/bootstrap-responsive.css" media="screen">
<link rel="stylesheet" type="text/css" href="style/bootstrapOverload.css" media="screen">
</head>
-- Css snippet -- /* wmu slider styles */ .wmuSlider { position: relative; overflow: hidden; height:385px; } .wmuSlider .wmuSliderWrapper { display: none; } .wmuSlider .wmuSliderWrapper article { position: relative; height:385px; }
.wmuSliderPagination { z-index: 2; position: absolute; left: 48%; bottom: 10px; } .wmuSliderPagination li { float: left; margin: 0 5px 0 0; list-style-type: none; } .wmuSliderPagination a { display: block; text-indent: -9999px; width: 10px; height: 10px; background: #92181b; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; } .wmuSliderPagination a.wmuActive { background: #c01d21; }
Any help would be greatly appreciated
Regards Alex.
3 Answers
John Locke
15,479 PointsHi Alex:
It's always better if you have either a live page or a Codepen that everyone can look at. It makes it much easier to debug.
John Locke
15,479 PointsHi Alex:
LocalHost just means it is on your computer only.
So there are no images in Firefox. What browsers is it working in, and which is it failing in?
John Locke
15,479 PointsI think it is actually lines 111 and 112 in bootstrapOverload.css - that stylesheet has the wmuSlider set to display: none.
Alex Sims
3,636 Pointsand voila, that fixes the problem. I really need to stop developing so late at night!
Thanks John
John Locke
15,479 PointsNo Problem!
Alex Sims
3,636 PointsAlex Sims
3,636 PointsThanks John I have put this site up on my test server here - http://localhost/FlowValve/# in some browsers it does not even produce any images, i.e. in firefox
Alex Sims
3,636 PointsAlex Sims
3,636 PointsOops my bad meant to post you this link http://ajsimsdesign.com - it is working in Chrome but Firefox and IE7/8 do not display the images, yet they show the pagination links.
Thanks for the speedy response!
John Locke
15,479 PointsJohn Locke
15,479 PointsAlex:
The images are there in Firefox and IE, but it looks like they aren't fading in for some reason. The minified version of the wmuSlider.js looks like it's targeting the "article" element, so that looks right. Did this work with the unminified version of the wmuSlider script previously?
Alex Sims
3,636 PointsAlex Sims
3,636 PointsI just tried changing to the un-minified version of the JS file and I am still seeing the same problem, I am beginning to think it may be something to do with Bootstrap, but I don;t see why that should be a problem.