0

I'm new here, and very appreciative for all the help I see in this online community.

My Question is about the circular option in jCarousel and the issue I'm having with it. I have a site I'm starting to build, and I have an example of the issue up on one of the pages. The site is very empty as of yet, however the example is there none the less.

Now for the code-

The HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Howard Ray Davis - jCarousel practice</title>
<script src="../assets/js/jquery.js" type="text/javascript"></script>
<script src="../assets/js/jcarousel.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  $(".slider").jCarouselLite({
      visible: 1,
      auto: 1000,
      speed: 1000,
      scroll: 1
  });
});
</script>
<link href="../hrd.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="aa" style="text-align=: center;">
  <h1>jCarousel Practice</h1>
</div>
<div id="ba">
  <div id="bb">
    <div id="bc">
      <div class="slider">
          <ul>
            <li class="fl"><div style="width: 800px;height: 300px;background-color: #F00;"></div></li>
            <li class="fl"><div style="width: 800px;height: 300px;background-color: #666;"></div></li>
            <li class="fl"><div style="width: 800px;height: 300px;background-color: #0FF;"></div></li>
            <li class="fl"><div style="width: 800px;height: 300px;background-color: #C09;"></div></li>
           </ul>
      </div>
    </div>
  </div>
</div>
<div id="ya"></div>
<div id="za">
</div>
</body>
</html>

The CSS:

@charset "utf-8";
* {
    margin: 0px;
    padding: 0px;
}
html {
    height: 100%;
}
body {
    position: relative;
    height: 100%;
}
#aa {
    width: 100%;
    height: 60px;
    background-color: #333;
    color: #FFF;
    text-align: center;
}
#ba {
    width: 100%;
}
#bb {
    width: 1000px;
    margin: auto;
}
#bc {
    width: 800px;
    margin: auto;
    overflow: hidden;
}
#ya {
    width: 100%;
    height: 40px;
    margin-top: 10px;
}
#za {
    width: 100%;
    height: 40px;
    position: absolute;
    bottom: 0px;
    background-color: #333;
}

Any help with solving this issue would be greatly appreciated!

1 Answers1

1

Doesn't look like the problem is with your CSS or JS. I went to your example site and downloaded your HTML source, the problem is in this block of code:

&nbsp;&nbsp;&nbsp;&nbsp;  <ul style="margin: 0pt; padding: 0pt; position: relative; list-style-type: none; z-index: 1; width: 4800px; left: -3286.26px;"><li style="overflow: hidden; float: left; width: 800px; height: 300px;" class="fl"><div style="width: 800px; height: 300px; background-color: rgb(204, 0, 153);"></div></li>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <li style="overflow: hidden; float: left; width: 800px; height: 300px;" class="fl"><div style="width: 800px;height: 300px;background-color: #F00;"></div></li>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li style="overflow: hidden; float: left; width: 800px; height: 300px;" class="fl"><div style="width: 800px;height: 300px;background-color: #666;"></div></li>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li style="overflow: hidden; float: left; width: 800px; height: 300px;" class="fl"><div style="width: 800px;height: 300px;background-color: #0FF;"></div></li>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li style="overflow: hidden; float: left; width: 800px; height: 300px;" class="fl"><div style="width: 800px;height: 300px;background-color: #C09;"></div></li>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<li style="overflow: hidden; float: left; width: 800px; height: 300px;" class="fl"><div style="width: 800px; height: 300px; background-color: rgb(255, 0, 0);"></div></li></ul>

Lines 155-160 of your HTML file. My guess is you're trying to use the &nbsp's as pseudo-padding or margins. Remove those and just add a margin-top: 10px to div.slider and it should work as you expect it to.

David Savage
  • 1,562
  • 2
  • 18
  • 35
  • I've never used `&nbsp` to space anything, first off it would be a waste of time coding, and secondly css does a fine job. I went to the page via chrome, firefox, ie, and maxthon and haven't seen the `&nbsp` problem in their inspector. – Howard Ray Davis Aug 08 '11 at 13:28
  • Also, I added the `margin-top: 10px` and still have the first slide down lower than the last. it appears that the first slide is reloaded with a clear list item, and the first slide is bumped down to create room. Thanks for the suggestions! – Howard Ray Davis Aug 08 '11 at 13:31
  • The ` `'s are there. It may not show up in inspector, but it is in your source code. Try using the View Source option in your browser (in Firefox, View -> Page Source). If I were a betting man, I'd say its because you've wrote the page in some web design software, such as Dreamweaver or Frontpage. I copied the code above straight from your source, so it is definitely there :) – David Savage Aug 09 '11 at 06:41
  • Are they only on the block of code that you've shown? That block of code is modified by jCarousel, my guess is that jCarousel has something to do with the excess ` `s. regardless i've tried removing all the spacing and it still has the glitch. it seems it is a list item problem, but i haven't yet found how to fix it. once again i appreciate your suggestions. – Howard Ray Davis Aug 09 '11 at 13:37
  • I'm not sure why you're not seeing them. Steps I took to get it: http://howardraydavis.com/learning/jcarousel.php went there, used Firefox File -> Save Page As.. and downloaded it to my desktop so I could mess around with the source. Opened jcarousel.php.html that was saved to my desktop using the Save Page As... and saw all the ` `'s when I opened the file in jEdit (usual HTML editor). – David Savage Aug 09 '11 at 17:54
  • Removing them fixed the problem on my local system. Perhaps this happens because in your text editor it is encoding your spaces as ` `'s? I'm not too sure, and maybe that's just an artifact of the download, but it did fix the problem on my system when removing them. Try it out yourself. – David Savage Aug 09 '11 at 17:55
  • the thing is, i coded the entire page with the same text editor, now that i see what you are talking about, i am led to believe it is the jCarousel that created the ` `'s. because it is only in the code block that jCarousel controls. thanks, i'll have to use the technique you've shown me next time. now to see if I can fix it. – Howard Ray Davis Aug 10 '11 at 02:35