JQuery FancyBox、Prepend函数和<a href>标签在IE7和IE8中不起作用.(其他浏
JQuery FancyBox, Prepend function and <a href> tag does not work in IE 7 and 8..(other browsers work ok functionally)
我写了一个代码,其中包括当点击缩略图时显示fancybox的jquery,以及添加标签以在图像缩略图顶部(层顶部)显示放大镜标签的prepend函数。奇怪的是,当网页在IE中渲染时,缩略图似乎"不可点击"(既没有显示手光标,也没有提供链接功能),因此无法在渲染中显示或运行fancybox脚本。其他浏览器,如Firefox、Chrome,可以完美地同时运行这三种功能。
以下是一段html代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Private Functions /title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico"/>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" media="screen,projection" href="css/ui.totop.css" />
<link rel="stylesheet" href="colorbox.css" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/Proxima_Nova_Rg_400-Proxima_Nova_Rg_700-Proxima_Nova_Rg_italic_400-Proxima_Nova_Rg_italic_700.font.js"></script>
<script type="text/javascript" src="js/BernhardMod_BT_400-BernhardMod_BT_700-BernhardMod_BT_italic_700.font.js"></script>
<script type="text/javascript" src="js/Liberation_Serif_400-Liberation_Serif_700-Liberation_Serif_italic_400-Liberation_Serif_italic_700.font.js"></script>
<script type="text/javascript" src="js/Gotham_Book_325-Gotham_Medium_350-Gotham_Book_italic_325-Gotham_Medium_italic_350.font.js"></script>
<script type="text/javascript" src="js/Gotham_Light_300-Gotham_Bold_400-Gotham_Light_italic_300-Gotham_Bold_italic_400.font.js"></script>
<script type="text/javascript" src="js/Gotham_Thin_250-Gotham_Bold_400-Gotham_Thin_italic_250-Gotham_Bold_italic_400.font.js"></script>
<script type="text/javascript" src="source/jquery.fancybox.js"></script>
<link rel="stylesheet" type="text/css" href="source/jquery.fancybox.css" media="screen" />
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" media="screen,projection" href="css/ie7.css" />
<![endif]-->
<script src="colorbox/jquery.colorbox.js" type="text/javascript"></script>
<!-- easing plugin ( optional ) -->
<script src="js/easing.js" type="text/javascript"></script>
<!-- UItoTop plugin -->
<script src="js/jquery.ui.totop.js" type="text/javascript"></script>
<script type="text/javascript">
Cufon.replace('#controls .left, #controls .right, #footer .wrap', { fontFamily: 'Proxima Nova Rg' });
Cufon.replace('#nav2 li, #nav2 li a, .sidebar .menu ul li', { fontFamily: 'Gotham Book' });
Cufon.replace('#nav2 li a.selected', { fontFamily: 'Gotham Medium' });
Cufon.replace('.content h2', { fontFamily: 'Gotham Thin' });
Cufon.replace('.content p', { fontFamily: 'Liberation Serif' });
jQuery(function(){
/*
var defaults = {
containerID: 'moccaUItoTop', // fading element id
containerHoverClass: 'moccaUIhover', // fading element hover class
scrollSpeed: 1200,
easingType: 'linear'
};
*/
$("<span></span").prependTo('.thumbnails a');
$().UItoTop({ easingType: 'easeOutQuart' });
});
</script>
<script type="text/javascript">
$(document).ready(function() {
/*
Simple image gallery. Uses default settings
*/
$(".thumbnails a").fancybox();
});
</script>
</head>
<body>
<div class="content">
<div class="banner"><img src="images/history-banner.jpg" alt="History of 333 Collins Street Melbourne" title="Melbourne's Most Exclusive Address - History"/></div>
<h2>Fusce nisi 333 Collins for your private function</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In lacinia dolor orci. Nulla tempus faucibus velit quis euismod. Mauris nec tellus sapien. Nullam bibendum, augue sed eleifend fermentum, neque orci pulvinar nunc, quis laoreet enim arcu ac ipsum.</p>
<p>Sed sit amet lorem ipsum, ac ornare tortor. Donec non mauris consectetur nulla convallis venenatis. Morbi facilisis molestie nisi, et scelerisque arcu pulvinar sit amet. In vehicula eros in nisl dictum iaculis.</p>
<div class="thumbnails">
<a href="gallery/private-functions/private-function-2.jpg" title="Private Function 1"><img src="images/private-function-1.jpg" width="220" height="122" alt="Private Function 1"/></a>
<a href="gallery/private-functions/private-function-1.jpg" title="Private Function 2"><img src="images/private-function-2.jpg" width="220" height="122" alt="Private Function 2"/></a>
<a href="gallery/private-functions/private-function-3.jpg" title="Private Function 3"><img src="images/private-function-3.jpg" width="220" height="122" alt="Private Function 3" class="norightmargin"/></a>
</div>
</div>
</body>
</html>
和一段css:
/** -----CONTENT --------------------*/
.content { padding-bottom: 3em; float:right; width:703px; height: auto; margin-right: 76px; }
.banner{height:180px; width: 700px; margin-bottom:47px;}
.content h1{margin-bottom:28px; font-size:25pt;color: #000000;}
.content h2{margin-bottom:28px; font-size:25pt;color: #000000;}
.content p{margin-bottom:36px; font-size:13pt; line-height: 25pt;}
.content p cufon{ margin-bottom:7px;}
.content .thumbnails img{
border:none; margin-right:15px; margin-bottom:20px;z-index:-10;
}
.content .thumbnails img.norightmargin{
margin-right: 0px;
}
.content .thumbnails a span{
width:220px; position: absolute;
height: 122px;
}
.content .thumbnails a span:hover{
background: url(images/rollover-magnifier.png) no-repeat;
}
我很感激是否有任何建议的纠正解决方案,使图像缩略图可以点击,以及弹出使用fancybox。谢谢
我怀疑css的这一部分正在创建冲突
.content .thumbnails a span{
width:220px; position: absolute;
height: 122px;
}
看起来锚落在绝对定位的"预处理"span
之后
例如,如果你有类似的东西
.content .thumbnails a {
width:240px;
}
你会看到只有锚的最后20像素是可以点击的。当然,我们在这里谈论IE。
相关文章:
- Recaptcha在IE7和IE8中不起作用
- Google地图API(IE7 IE8)的堆栈溢出
- ie7和ie8中的JQuery/Javascript问题
- IE9中的有效输出,但IE7/IE8中的未定义输出
- Onclick无法在IE8和IE7中启用只读字段
- 无法在 IE 9 中传递此运算符的值,而它在 IE7 和 IE8 中工作正常
- 在 IE7 和 IE8 中单击图像时触发的 window.blur
- 使用onsubmit函数的Javascript验证在IE8和IE7中不起作用
- Facebook 画布:IFrame 中的内容在 IE7 和 IE8 中被截断
- IE7/IE8 中的 Javascript JSON Date 解析返回 NaN
- .live() 中的 jQuery .select() 在 IE7 和 IE8 上不起作用
- ExCanvas 在 IE7 和 IE8 IFrame 中不起作用
- 谷歌图表适用于IE7,但不适用于IE8或IE9
- 获取尾随逗号(在JavaScript中)在IE7 / IE8中工作
- IE8 / IE7 / IE6似乎将通过JQuery插入的锚标记视为块级元素
- Facebook评论小部件使页面在IE7 IE8中跳到底部
- jquery设置隐藏的输入值在IE7和IE8中未按预期工作
- IE7 和 IE8 不会在提交 JavaScript 时触发 JavaScript 提交
- 如何在IE8(ie7,ie6)中固定边界半径
- 复选框& # 39;改变# 39;事件在单击标签时起作用.ie8, ie7