The buttons are not child elements of the slider even though they are positioned within it:
<div id="slider" style="overflow: hidden; width: 620px; height: 330px;">
<div id="slider_overlay"></div>
<ul style="width: 3100px; margin-left: -620px;"></ul>
</div>
<span id="prevBtn" style="display: none;">
<a href="javascript:void(0);">Previous</a>
</span>
<span id="nextBtn" style="display: none;">
So when your mouse enters them it's leaving $('#slider')
, triggering the out
callback specified here:
var buttons = $('#prevBtn,#nextBtn');
var hide = function () { buttons.stop(true, true).fadeOut(); }
var show = function () { buttons.stop(true, true).fadeIn(); }
$("#slider").hover(show, hide);//show/hide buttons
I recommend moving the previous and next buttons (spans) into the slider div, so that they are truly its children in the DOM instead of only appearing to be child elements.
Edit: I didn't realize the prevBtn and NextBtn spans were generated by the slider plugin, d'oh. I haven't had the chance to reivew the entire plugin code, but it looks like you might be able to get away with changing line 94 of easySlider1.7.js from
$(obj).after(html);
to
$(obj).append(html);
Since that would insert them inside the slider div. If that has undesirable side effects or it still doesn't work, you might just add this to your $(document).ready()
:
$("#prevBtn,#nextBtn").hover(function() { buttons.stop(true, true).show(); });
Without testing it, I'm not sure if there's any flicker, but it should ensure the buttons are showing when the mouse is over them.