0

I've created a slideshow using EasySlider and I've added a hover/animate function to add a caption overlay that is able to launch Shadowbox.

My problem is that the last slide seems to make my caption sequence null. The function will run while the slide is in transition, but when it finishes the caption returns to its original position. This only happens on the last slide of the sequence.

Can anyone tell me how I might alter my caption function or EasySlider to get this to work?

http://zachinscho.com/save/kreber_test/V2/

Thanks

2 Answers 2

2

I know this is an old post, and I'm sure Marlin solved the text function for many - but if anyone is looking for a solution to add captions (which doesn't involve changing the js) I've added a class to the css (the easyslider screen.css file) and a hover class to define the behaviour of the text:

css:

.stext {
display: none; 
position: absolute; 
margin-top: -29px; 
width: 660px; 
left:0px; 
padding: 7px 0px;
}
#slider li:hover .stext {
display: block; 
background: #000000; 
opacity: 0.5; 
filter: alpha(opacity=50); 
padding-left: 10px; 
padding-right: 10px; 
font-family: Trebuchet MS, Arial, sans-serif; 
font-size: 12px; 
color: #eeeeee; 
text-decoration: none;
}       

and the html (I have just included the first slide as an example:

<div id="slider">
    <ul>                
        <li><img src="images/slide-01.jpg" alt="image description" />
         <a href="#"><span class="stext">caption text to show on hover</span></a></li>
0

Zach, I honestly can't find an error with your code but if you take off the individual listeners and apply a universal listener for all slides, it fixes your problem

$('#easysliderMain li').hover(function(){
     $(".cover", this).stop().animate({top:'250px'},{queue:false,duration:160});
}, function() {
     $(".cover", this).stop().animate({top:'280px'},{queue:false,duration:160});
});
1
  • Perfect, Thanks so much. You solved my issue and knocked about 40 lines out of my code, couldn't have asked for a better response haha Jun 29, 2011 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.