- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
出于某种奇怪的原因,我的脚本中显示和隐藏对象的部分似乎不起作用。我不确定是否是 Firefox 不喜欢这样,或者是否是我拥有的基于函数的代码(以节省重复的代码行)?
有一个工作示例 here javascript 是 here
** 这是 jquery **
$(document).ready(function(){
totUpPrices();
checkBedType();
checkHeadboardOption();
$('.bedtype_price').click(function()
{
checkBedType();
});
$('.headboard_option').click(function()
{
checkHeadboardOption();
});
$('#bed-floater').scrollFollow({ offset:10 });
$('.texture').click(function()
{
$('.texture').removeClass("checked");
$('.texture').children("input").attr("checked","");
$(this).addClass("checked");
$(this).children("input").attr("checked","checked");
});
$('.pricechanger_auto').change(function()
{
totUpPrices();
});
$('.bed-width-single').change(function()
{
if($(this).val()=="2' 6\"" || $(this).val()=="3'")
{
$('.pocketmatic-mattress').attr("disabled","");
}
else
{
$('.pocketmatic-mattress').attr("disabled","disabled");
if($('.pocketmatic-mattress').parent("select").val()=="Pocketmatic")
{
$('.pocketmatic-mattress').parent("select").children("option[value='']").attr("selected","selected");
}
}
});
$('.bed-width-twin').change(function()
{
if($(this).val()=="4' 6\"" || $(this).val()=="6'")
{
$('.pocketmatic-mattress').attr("disabled","");
}
else
{
$('.pocketmatic-mattress').attr("disabled","disabled");
if($('.pocketmatic-mattress').parent("select").val()=="Pocketmatic")
{
$('.pocketmatic-mattress').parent("select").children("option[value='']").attr("selected","selected");
}
}
});
function totUpPrices()
{
var totalprice = 0;
// Check Type of bed prices
var objs = $('.bedtype_price');
$.each(objs, function(index, value) {
if($(value).attr("checked"))
{
totalprice = totalprice + parseInt($(value).attr("cost"));
}
});
// Check Delivery Options
var objs = $('.deliveryoptions_price');
$.each(objs, function(index, value) {
if($(value).attr("checked"))
{
totalprice = totalprice + parseInt($(value).attr("cost"));
}
});
// Check Dropdown Prices
var objs = $('.select_price');
$.each(objs, function(index, value) {
newvalue = $(value).attr("value");
$.each($(value).children("option"), function(i, l){
if($(this).attr("value")==newvalue)
{
totalprice = totalprice + parseInt($(this).attr("cost"));
}
});
});
$('#totalincvat').text(totalprice);
}
function checkBedType()
{
var objs = $('.bedtype_price');
var checkedType = '';
$.each(objs, function(index, value) {
if($(value).attr("checked"))
{
checkedType = $(value).val();
}
});
if(checkedType == "Single Bed")
{
$('.show_with_single').show();
$('.show_with_twin').hide();
$('.changeOnTwin').text("Would you like a headboard?");
}
else
{
$('.show_with_twin').show();
$('.show_with_single').hide();
$('.changeOnTwin').text("Would you like headboards?");
}
}
function checkHeadboardOption()
{
var objs = $('.headboard_option');
var checkedType = '';
$.each(objs, function(index, value) {
if($(value).attr("checked"))
{
checkedType = $(value).val();
}
});
if(checkedType == "Yes")
{
$('.headboard-options').show();
}
else
{
$('.headboard-options').hide();
}
}
});
感谢所有帮助
最佳答案
您的 HTML 未通过验证。请参阅此处,
您的 html 的第一行已经无效。
抱歉,你的第一行没问题,我不知道那是 HTML5,尽管现在做 HTML5 还为时过早。
关于javascript - Jquery .show() 和 .hide() 甚至 .css( {"display":"none"});不在火狐浏览器中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2644109/
如何从 中删除选定的附件元素 ? 当您已经选择一个附件时,Firefox 似乎无法删除附件。 我尝试删除名称并点击打开,但没有任何反应。 我也试过取消,但附件还在。 我的解决方案是添加一些 oncl
我在 Firefox(版本 38.05)中遇到一个非常奇怪的错误。我有一个如下所示的表单,以及一段用于验证的 Javascript Javascript function ch
所以我知道how to使用 CSS 指定 HTML input 占位符的颜色。然而,这似乎不适用于 Mozilla Firefox 中 number 类型的 input 字段(尽管在 Chrome 中
我创建了简单的类似 hello world 的插件,它绘制了红色框。 嵌入 xulrunner 应用程序后,该插件几乎可以正常工作。 Xulrunner 应用程序在调整应用程序窗口大小时成功重绘了框。
我在 Firefox javascript 中遇到了一件非常奇怪的事情。我创建了一个对象,并使用字符串作为键。当我看到“watch”键是否有值时,如果其中没有“watch”键,它会通过返回 Objec
好的。我知道我问的是一个老生常谈的问题,但我发布这个问题是因为尽管尝试了各种链接上提供的所有解决方案,我的问题仍未得到解决。 我的限制 - 我不想使用已保存的 Firefox 配置文件来保存网站的证书
我只是想知道如何通过浏览器(Firefox)调用 WCF 服务? 我的 WCF 服务如下所示: http://localhost:4249/TestService.svc 我试过这个: [Servic
想要一些帮助来解释为什么这不起作用 from selenium import webdriver browser = webdriver.Firefox() browser.get('https://
Firefox 是一种浏览器,没有它我什至无法想到开发 Web 应用程序。它带有许多方便的附加组件和功能,使开发人员的工作变得轻松。 然而,Firefox 的功能非常庞大,并不是每个人都知道它们。因此
我的吉普车有一个基于浏览器的服务手册。在 IE 中运行良好,但在 Firefox 中运行不佳。基本上有一个目录,您可以展开并深入到子主题,例如 [+] 手拿包 [+] 冷却 [+] 电气 但是 Fir
看了一下,发现了一些东西,但似乎没有什么能像我想要的那样工作。 最初我有我的解决方案与 internet explorer 和 chrome 一起工作,但不是 firefox(这让我不满意不能工作)
编辑我有一个状态栏,可用于启用和禁用插件。 最佳答案 定义时: 您的弹出窗口由两个元素组成,image 和 menuitem。弹出窗口
我在菜单中定位悬停效果时遇到问题。在 Firefox 中没问题,但在 chrome 中悬停效果是 UP 的问题。 Firefox:(这里可以) http://pasteboard.co/1ami0qr
这个问题在这里已经有了答案: †appearing instead of quotation marks (1 个回答) 关闭 5 年前。
我的 ASP.net 网站中的一个 GridView header 有问题。我想在我的标题单元格中显示绿色背景颜色的白色文本。我还想让这些单元格的边框颜色保持黑色。 这是我用于标题的 CSS: .my
我有这个输入,在 :before 标签中定义了一些内容。在 IE 和 Chrome 中它运行完美,但 Firefox 把它弄得一团糟。 内容应该在输入标签中可见,但在 Firefox 中,内容在 in
谁能告诉我为什么 firefox 没有打开并添加了以下 Net::HTTPServer 行? #!/usr/bin/perl # v5.10.1 / linux use strict; use war
我和我的同事在使用 Firefox 3.0.6 访问我们正在开发的 Java 1.6.0___11 Web 应用程序时遇到问题。 session 开始后 1 到 30 分钟内一切正常...但最终,连接
friend , 我注意到在 Firefox v23.0.1 中,HTMLElement(input,button..etc) 的 hasOwnProperty 不起作用, button1.hasOw
有什么办法可以禁用这个“功能”吗? 例如,如果向 http://localhost/foo.html 发出请求,并且我已将其指定为根地址“301”,则所有后续请求都会发送到 foo.html。 htm
我是一名优秀的程序员,十分优秀!