Lightbox
在我使用jQuery
..
进行选项卡导航后不再工作了。Chrome
可视化很好,但是Firefox
一团糟。
我做错了,因为event.preventDefault();
并且没有工作(在单击选项卡控制器return false
的锚点后,我不得不使用滚动返回页面底部)a href="#id_name
任何帮助,将不胜感激。
头:
<!-- Lightbox + Prototype + jQuery -->
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') { document.write(unescape("%3Cscript src='js/jquery-1.8.0.min.js' type='text/javascript'%3E%3C/script%3E")); }
</script>
用于标签导航的 jQuery:
<script type="text/javascript">
$(document).ready(function() {
//Default Action
$(".tab_content").hide(); //Hide all content
$("ul.bmenu li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
//On Click Event
$("ul.bmenu li").click(function(event) {
event.preventDefault(); //non impedisce di scrollare to Top
$("html, body").animate({ scrollTop: $(document).height() }, "slow");
$("ul.bmenu li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false; //non impedisce di scrollare to Top
});
});
</script>
一些 HTML:
<div class="tab_content content" id="tab2">
<div class="images_grid"> <!-- images_grid_collezione -->
<!-- Riga 1 -->
<a href="imgs_grid/Rosso_01.png" rel="lightbox[medardo_rosso]"><img class="grid_img" src="imgs_grid/Rosso_01.png" alt="" /></a>
<a href="imgs_grid/Rosso_02.png" rel="lightbox[medardo_rosso]"><img class="grid_img" src="imgs_grid/Rosso_02.png" alt="" /></a>
我将网站上传到这里的临时目录中。