IE8 中的 JQuery 切换问题
下面是我的 JQuery 代码:
$("#contact").live('click', function(event) {
$(this).addClass("selected").parent().append('<form name="emailform"><div class="messagepop pop"><p><label for="sname">Your Name</label><input type="text" size="30" name="sname" id="sname" /></p><p><label for="email">Your Email</label><input type="text" size="30" name="email" id="email" /></p><p><input type="submit" value="Send Reservation Summary" name="commit" id="message_submit" class="btn"/> <button class="btn close">Cancel</button></p></div></form>');
$(".pop").slideFadeToggle(function() {
$("#sname").focus();
});
return false;
});
$.fn.slideFadeToggle = function(easing, callback) {
return this.animate({ opacity: 'toggle', height: 'toggle' }, "fast", easing, callback);
};
从上面的代码中,当我单击按钮时,会弹出一个带有一些幻灯片动画的弹出窗口,它在除 IE8 之外的所有其他浏览器中都可以正常工作,任何人都可以告诉我我在哪里转错了
谢谢
below is my JQuery code:
$("#contact").live('click', function(event) {
$(this).addClass("selected").parent().append('<form name="emailform"><div class="messagepop pop"><p><label for="sname">Your Name</label><input type="text" size="30" name="sname" id="sname" /></p><p><label for="email">Your Email</label><input type="text" size="30" name="email" id="email" /></p><p><input type="submit" value="Send Reservation Summary" name="commit" id="message_submit" class="btn"/> <button class="btn close">Cancel</button></p></div></form>');
$(".pop").slideFadeToggle(function() {
$("#sname").focus();
});
return false;
});
$.fn.slideFadeToggle = function(easing, callback) {
return this.animate({ opacity: 'toggle', height: 'toggle' }, "fast", easing, callback);
};
From the above code, when I click a button, a popup will popped up with some slide animation, it works fine with every other browser except in IE8, can anybody tell me where did I make the wrong turn
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案
add
$.fn.slideFadeToggle = function(easing, callback) {
return this.animate({ opacity: 'toggle', height: 'toggle' }, "fast", easing, callback);
};
之前
现在工作正常:)
I found the solution
add
$.fn.slideFadeToggle = function(easing, callback) {
return this.animate({ opacity: 'toggle', height: 'toggle' }, "fast", easing, callback);
};
before
Now it works fine :)