I have a site with two plugins: jscrollpane and fancybox.
I want a div with jscrollpane to scroll until is finish. and inside there are many image clickable with fancybox.
When I scroll down with the scroller (scroll-pane) and click an image doesn't open a fancybox but go to the top of the div. Why? If I don't scroll the div and click on the first photo the fancybox works. How to fix this problem?
This is my javascript and html
<script type="text/javascript">
$(document).ready(function() {
$(function()
{
jQuery('.scroll-pane').jScrollPane({
autoReinitialise: true
});
});
$("a.fancy").fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : 600,
'speedOut' : 200,
'overlayShow' : true
});
});
</script>
<div class="scroll-pane">
<a href="img/gallery/big/01.jpg" class="fancy" rel="group"><img src="img/gallery/thumb/01.jpg" class="gallery" style="margin-top:0px;"/></a>
<a href="img/gallery/big/02.jpg" class="fancy" rel="group"><img src="img/gallery/thumb/02.jpg" class="gallery" style="margin-top:0px;"/></a>
<a href="img/gallery/big/03.jpg" class="fancy" rel="group"><img src="img/gallery/thumb/03.jpg" class="gallery" style="margin-top:0px;"/></a>
<a href="img/gallery/big/04.jpg" class="fancy" rel="group"><img src="img/gallery/thumb/04.jpg" class="gallery" style="margin-top:0px;"/></a>
<a href="img/gallery/big/05.jpg" class="fancy" rel="group"><img src="img/gallery/thumb/05.jpg" class="gallery" style="margin-top:0px;"/></a>
<a href="img/gallery/big/06.jpg" class="fancy" rel="group"><img src="img/gallery/thumb/06.jpg" class="gallery" /></a>
</div>
css of scroll-pane
.scroll-pane
{
width: 98%;
height: 380px;
overflow: auto;
}