English 中文(简体)
jQuery - jCarouselLite - Images are not showing up
原标题:

I have incorporated jCarouselLite with my already working site, however the PREV and NEXT buttons appear, but no IMAGES. The image links are correct.

Any ideas?

jQUERY:

<script type="text/javascript">
    //jCarouselLite
    $(function() {
        $(".slider").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
        visible: 4
    });
});
</script>

HTML:

<div id="list">           
<div class="prev"><img src="images/prev.jpg" alt="prev" /></div>
<div class="slider">
<ul>
<li><a href="#" title="Title 1"><img src="images/store_item_img.jpg" alt="Image 1" class="captify" /></a></li>
<li><a href="#" title="Title 2"><img src="images/store_item_img.jpg" alt="Image 2" class="captify" /></a></li>
<li><a href="#" title="Title 3"><img src="images/store_item_img.jpg" alt="Image 3" class="captify" /></a></li>
<li><a href="#" title="Title 4"><img src="images/store_item_img.jpg" alt="Image 4" class="captify" /></a></li>
<li><a href="#" title="Title 5"><img src="images/store_item_img.jpg" alt="Image 5" class="captify" /></a></li>
<li><a href="#" title="Title 6"><img src="images/store_item_img.jpg" alt="Image 6" class="captify" /></a></li>
<li><a href="#" title="Title 7"><img src="images/store_item_img.jpg" alt="Image 7" class="captify" /></a></li>
<li><a href="#" title="Title 8"><img src="images/store_item_img.jpg" alt="Image 8" class="captify" /></a></li>
</ul>
</div>
<div class="next"><img src="images/next.jpg" alt="next" /></div> 
</div>

CSS:

.slider {
 background-color:#3399FF;
 float:left;
 margin:15px; 
 position:relative; 
 visibility:hidden; 
}

.slider ul {
 height:180px;
 width:840px; 
}

.slider ul li {
 padding:0 20px;
}

.slider ul li img {
 cursor:pointer;
 height:150px; 
 padding-top:3px;
 width:180px;  
}

.prev {
 cursor:pointer; 
 float:left;
 padding-top:90px;
}

.next {
 cursor:pointer; 
 float:right; 
 padding-top:90px;
}

SCRIPT:

<script type="text/javascript" src="http://www.theratio.net/js/jquery.js"></script>
<script type="text/javascript" src="js/jcarousellite_1.0.1.pack.js"></script>
<script type="text/javascript" src="js/captify.tiny.js"></script>

Please Help?

:)

UPDATE:

If I remove

  $("#store_container").hide();

..and make it look like this, it works, however the div is opened first instead of closed.

<script type="text/javascript">
$(function(){
  $( #toggle ).toggle(function(){
     $( #store_container ).slideDown("slow", function() { $( #store_data ).fadeIn(); });
   }, function() {
     $( #store_data ).fadeOut("fast", function() { $( #store_container ).slideUp("slow"); });
  });
});
</script>

How can I made #store_container be closed with using .hide ? Or is there a way to show it after the function is clicked?

最佳回答

I don t know anything about jCarouselLite, but in your style, your .slider is set to visibility:hidden; and I don t see anything in your code that makes it visible.

EDIT:

Don t forget:

$( document ).ready(function(){
    // my jquery javascript code
})
问题回答

Are you sure you ve included the jQuery and jCarouselLite scripts properly? Does Firebug show the scripts? Any errors?

did you get this figured out? The images need their height and width attributes.





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签