1

I am working on my portfolio which you can visit here. onclick commands are for hiding and showing the different divs that are of my artwork.

I found a boxslider code to help show off my photographs, but when I initially load the page the frame is empty. It is only after I inspect the element that the pictures will appear.

I also keep on getting this error which I am pretty certain have something to do with the boxslider frame not loading my pictures:

Uncaught TypeError: Cannot read property 'style' of null

Here is part of css of the boxslider frame:

.bx-wrapper {
  position: relative;
  margin: 0 auto 60px;
  padding: 0;
  *zoom: 1;
  -ms-touch-action: pan-y;
  touch-action: pan-y;
}
.bx-wrapper img {
  max-width: 90%;
  display: block;
}
.bxslider {
  margin: 0 auto;
  padding: 0 auto;

}
ul.bxslider {
  list-style: none;
}
.bx-viewport {
  /*fix other elements on the page moving (on Chrome)*/
  -webkit-transform: translatez(0);
}
/** THEME
===================================*/
.bx-wrapper {
  -moz-box-shadow: 0 0 5px #ccc;
  -webkit-box-shadow: 0 0 5px #ccc;
  box-shadow: 0 0 5px #ccc;
  border: 5px solid #fff;
  background: #fff;
}
.bx-wrapper .bx-pager,
.bx-wrapper .bx-controls-auto {
  position: absolute;
  bottom: -30px;
  width: 100%;
}
/* LOADER */
.bx-wrapper .bx-loading {
  min-height: 50px;
  background: url('images/bx_loader.gif') center center no-repeat #ffffff;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2000;
}
/* PAGER */
.bx-wrapper .bx-pager {
  text-align: center;
  font-size: .85em;
  font-family: Arial;
  font-weight: bold;
  color: #666;
  padding-top: 20px;
}
.bx-wrapper .bx-pager.bx-default-pager a {
  background: #666;
  text-indent: -9999px;
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 5px;
  outline: 0;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;
}
.bx-wrapper .bx-pager.bx-default-pager a:hover,
.bx-wrapper .bx-pager.bx-default-pager a.active,
.bx-wrapper .bx-pager.bx-default-pager a:focus {
  background: #000;
}
.bx-wrapper .bx-pager-item,
.bx-wrapper .bx-controls-auto .bx-controls-auto-item {
  display: inline-block;
  *zoom: 1;
  *display: inline;
}
Madness
  • 2,730
  • 3
  • 20
  • 29
matthewolf
  • 11
  • 3

1 Answers1

1

You should try setting up each bxSlider individually. In your js.js file do this:

var wood = $(".wood").bxSlider();
var book = $(".book").bxSlider();
var bw   = $(".bw").bxSlider();

and in your HTML do this:

<ul class="wood">
  <li>.....

<ul class="book">
  <li>.....

<ul class="bw">
  <li>.....

Just a suggestion, if your using HTML5 (which you are with <!doctype html>), you shouldn't use<center> it's even deprecated in HTML4. Actually get rid of those <center> I'm pretty sure using HTML5 may totally reject rendering them hence the error code calling <center> null.

You also have this:

 <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>

<!-- image slider -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

You only need one of them.

Once you have done those 3 things and it's still not fixed, I have one more idea.

zer00ne
  • 41,936
  • 6
  • 41
  • 68
  • Hey, thanks for your help. I've uploaded my website with your edits but still I the same problem keeps occurring. I think I'm realizing that the Uncaught TypeError has something to do with ul tag I used in creating different subjects I put my art in. Is it bad to have one ul tag within another? Maybe the css is overriding the others? – matthewolf Aug 23 '15 at 19:10
  • @matthewolf bxSlider can run with a `ul` inside of it, but wouldn't advice deviation from basic configurations until you have a good grasp of the plugin's API. There is a problem with Chrome PC, it might involve this: http://stackoverflow.com/questions/4390134/failed-to-load-resource-under-chrome . I'm not 100% sure... Firefox PC works. I disabled Google Analytic and put ONE jquery script before the bxSlider script. All script is at the closing tag of `

    ` As a general rule I place CSS at the head and scripts at the bottom. Btw, there's a lot of duplicate IDs (e.g. `id="gifs"`) ..cont>

    – zer00ne Aug 24 '15 at 12:58
  • @matthewolf <...Cont > This is invalid. IDs must always be unique. I was going to change the duplicate IDs into Classes but there's so many of them I'll leave that up to you :P I also took that code from `js.js` and placed it on the bottom of the page. The less `` and ` – zer00ne Aug 24 '15 at 13:09
  • @matthewolf http://glpjt.s3.amazonaws.com/test/mc5.html Oh, almost forgot, there's an error on this `X` I got to go to work, good luck. Btw, it loads REALLY slow, so use `Inspect Element` on the area where there's a bxSlider, it'll popup. If you still need help, I'll be around later in the evening. (UTC-7) PDT – zer00ne Aug 24 '15 at 13:16