jQuery函数。绑定在IE中不起作用
如果单击小缩略图,将显示较大的图像。在Chrome中它工作得很好,但当我在IE9中尝试它时,它什么也做不了。这是我的密码: jQueryjQuery函数。绑定在IE中不起作用,jquery,html,jquery-ui,bpopup,Jquery,Html,Jquery Ui,Bpopup,如果单击小缩略图,将显示较大的图像。在Chrome中它工作得很好,但当我在IE9中尝试它时,它什么也做不了。这是我的密码: jQuery // JavaScript Document //Button1 ;(function($) { // DOM Ready $(function() { // Binding a click event // From jQuery v.1.7.0 use .on() in
// JavaScript Document
//Button1
;(function($) {
// DOM Ready
$(function() {
// Binding a click event
// From jQuery v.1.7.0 use .on() instead of .bind()
$('#my-button').bind('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$('#element_to_pop_up').bPopup({
appendTo: 'form'
, zIndex: 2
, modalClose: false
});
});
});
})(jQuery);
//Button2
;(function($) {
// DOM Ready
$(function() {
// Binding a click event
// From jQuery v.1.7.0 use .on() instead of .bind()
$('#my-button1').bind('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$('#element_to_pop_up1').bPopup({
appendTo: 'form'
, zIndex: 2
, modalClose: true
});
});
});
})(jQuery);
;(function($) {
//Button3
// DOM Ready
$(function() {
// Binding a click event
// From jQuery v.1.7.0 use .on() instead of .bind()
$('#my-button2').bind('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$('#element_to_pop_up2').bPopup({
appendTo: 'form'
, zIndex: 2
, modalClose: false
});
});
});
})(jQuery);
还有我的HTML
<!-- Portfolio Popup Box -->
<div id="element_to_pop_up">
<a class="bClose">x<a/>
<img src="imgs/portfolio/bobbie.png" width="100%" height="100%" alt="Bobbie Gordon Website" />
</div>
<div id="element_to_pop_up1">
<a class="bClose">x<a/>
<img src="imgs/portfolio/jareth.png" width="100%" height="100%" alt="Bobbie Gordon Website" />
</div>
<div id="element_to_pop_up2">
<a class="bClose">x<a/>
</div>
<!-- Portfolio Popup Box End -->
我很确定这和装订线有关。也许我不认识它?或者,只要你点击它,它就会被取消,给人一种什么也没发生的感觉
谢谢大家
由于Sparky,此问题现已修复将.bind()
转换为jQuery版本或降级。您的站点正在运行。您还可以包括
此外,如果希望站点在资源管理器中正常工作,必须首先验证HTML:
您应该按照自己的注释进行操作:
//从jQuery v.1.7.0使用.on()而不是.bind()
。你的页面正在使用jQuery1.9。要想让一个站点在Explorer中正常工作,你必须首先验证HTML:哦,天哪,在没有睡眠的情况下,这真是太神奇了。。。谢谢:/migrate插件可以正常工作。虽然最好将bind
转换为on
。
#element_to_pop_up {
padding:5px;
color:#000;
display:none;
width:90%;
height: 100%;
position:absolute;
border:1px solid #000;
}
#element_to_pop_up1 {
padding:5px;
color:#000;
display:none;
width:90%;
height: 90%;
position:absolute;
}
#element_to_pop_up2 {
padding:5px;
color:#000;
display:none;
width:90%;
height: 90%;
position:absolute;
}
.bClose{
cursor:pointer;
position:absolute;
right:-15px;
top:-15px;
font-size:22px;
font-weight:bold;
}