views:

1111

answers:

3

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"&gt;&lt;/script&gt;
<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?

A: 

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

bdl
I have the images set to 150x180 in the CSS under .slider ul li img {}I have added the javascript above as well.Thank you for your help, I really appreciate it
iamtheratio
@iamtheratio> Yes, I noticed your CSS rules after I posted, and edited my post, my bad. I was looking for a specific img rule and passed over the ruleset.
bdl
+1  A: 

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
})
patrick dw
I have removed this property hoping to resolve the issue, but unfortunately it does not.
iamtheratio
I got the tutorial from here: http://www.onextrapixel.com/2009/04/28/jquery-jcarousel-lite-with-pretty-image-captions-that-appear-on-rollover/
iamtheratio
Is that the entirety of your Javascript? In the example above, you don't have jQuery's $('document').ready()
patrick dw
@patrick: you can view the project here: http://www.theratio.net/bickelampco/ Click on store, the images should appear between PREV and NEXT.
iamtheratio
For me, nothing shows up after it slides open. Just black space. The tutorial shows a $('img.captify').captify({ }); function that needs to be called from within jQuery's $('document').ready(). Are you doing that?
patrick dw
Yes, you can right click and view source to see that. Which browser are you using? I dont have image set up for next and prev yet.. I can make those really fast if you need them.
iamtheratio
I have added the images so you should be able to view at least those, thank you again for all the help.
iamtheratio
Well, all I can tell so far is that if you remove the store_container div and get rid of style="display:none;" in the store_data div, they show up. So there seems to be some issue with store_container. In my opinion, you should avoid placing style information in the html. Keep it in your style sheet.
patrick dw
Thanks patrick, I got it working without store_container as well, but without that, the slidedown jquery doesn't work anymore. Any ideas?
iamtheratio
I'm not sure if both jQuery scripts are what's the problem here, do you know if my slidedown/fadein and slideup/fladeout could be creating a bug with the jcarousel?
iamtheratio
Looks like you're using standard jQuery methods. I doubt a plugin developer would have any methods that would collide. I saw your question yesterday about the slider not hiding and showing the content properly. The fix you chose was effective, but didn't really solve the problem. The content on the inside of store_container should have been concealed when store_container closed. Since you are now having another problem with store_container, my guess is that both problems are related to some CSS somewhere. Try scaling all related CSS down to a minimum til it works, then work your way back.
patrick dw
First thing I'd do would be add 'position:relative' to store_container in your style sheet.
patrick dw
Well, I imported all your code and started scaling it down. I can't figure it out. I did have a little success when the html and css was down to almost nothing, and I got rid of the call to captify() in javascript. But still wasn't there. I would probably have to rebuild the website from scratch to get things to work. Sorry I couldn't help.
patrick dw
Thanks so much for all the help, I really appreciate it.I guess I'll have to do the same and hopefully I'll eventually find a way to make this work out correctly..
iamtheratio
Okay so I think I foudn something.. If I remove $('#store_container').hide() it works, yet the document is opened when you first load the page. Is there a way around this?This seems to work okay, but it's opened instead of closed at first.<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>
iamtheratio
You could try setting display:none in your css for store_container. Should have the same effect as .hide().
patrick dw
I believe something in the script adds display:none; to everything so the child div is still invisible, so that's weird.I'll try it and let you know.
iamtheratio
@patrick - unfortunately it does have the exact same effect as .hide(), which causes the child div #store_data to stay hidden. Is there a way to have the jquery change #store_container to .show(), then fade in, or something along those lines?
iamtheratio
Well, here's the trouble. What you're doing *should* work, which means that there's something amiss somewhere else. Your page structure didn't look too complicated, but there seemed to be a lot of CSS for it with a lot of display:inline and float:left. Maybe some of that is for the requirements of the plugins, I really don't remember. Ultimately, there's something else going on here. I'll try to construct a simple page that replicates what you're trying to do, and see if that works. If so, then there are some corrections that need to be made in your page elsewhere. I'll have something soon.
patrick dw
Ok, so I created a very simple site that displays the store in the way you want. When animating, it successfully hides and reveals its content. Copy this code and use it as a starting point. Put your slider code in the #store_container and see if it works. If so, then it shows that there's something else going on with your page. Then maybe just simply rebuild your site starting with the new code. Let me know how it goes. http://dalewhalen.com/iamtheratio/
patrick dw
@patrick: thanks, I'll try to rebuild when I have time, in the meantime I found a work around that seems to work alright here.. http://www.theratio.net/bickelampco/ However.. I'm not sure how to get the bottom content of the site you created centered at around 850px width, any ideas?
iamtheratio
You could still do the FadeIn. My point was that the store's 'reveal' should work on your site, but doesn't. That tells me that there's something else wrong that is probably affecting the rest of the site (or at least that area). Give me a few minutes, and I'll enhance the example a bit for you.
patrick dw
I see you've got it working. What did you do?
patrick dw
I added this to bypass the issue: $(window).load(function () {$("#store_container").hide();});It's still not right, but it works.
iamtheratio
To set the width, I added 'width: 850px; margin: 0 auto;' to #main in the style sheet. If you're interested, I uploaded a basic structure of your page, and included your fadeIn effect. Feel free to use it if you wish.
patrick dw
I bet that was my issue then, I tried using stupid weird centering techniques and I could have just used margin: 0 auto; gotta love it! I will build my site again probably because it's correct and the incorrect will bug me forever, but I definitely appreciate everything you've done. It's unbelievable the help I got, so thank you!
iamtheratio
Yeah, CSS is goofy sometimes. Glad I could help.
patrick dw
A: 

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

Lee Hinde