【发布时间】:2010-01-13 20:52:17
【问题描述】:
我编写了这段代码,它在 Google Chrome 中运行良好,但在 Firefox 和其他主流浏览器中,它甚至没有任何改变:
jQuery("div[style*='line-height:25px']").contents(":not(nodeType!='1',br)").wrap("<div style='margin-bottom:9px;line-height:normal;margin-top:4px'>");
jQuery("div[style*='line-height:25px'] br").remove();
这可能看起来有点奇怪,但这是我想要解决的一个非常令人沮丧的问题,所以无论如何让我给你关于系统的规格:
- jQuery 1.3.2 使用
noConflict()方法避免与原型$冲突 - Scriptaculous 1.7.1_beta3
- 原型 1.5.1
- 是的,我正在使用
jQuery(document).ready()函数在 DOM 准备好后执行操作。
这些也是嵌入在页面中的库。
推荐:
我没有开发这个页面和其他数百个类似的页面,问题是它们都是静态页面并且使用shtml 至少共享一些通用代码。但是我不能删除任何这些库,因为这意味着我将不得不编辑很多页面,这将花费我数周的时间。所以实际上我正在寻找的是像上面这样的临时解决方案。
提前致谢。
部分 HTML :
<div style="font-size: 13px; line-height: 25px;">
<!-- BULLETS MORE -->
<div style="line-height: normal;">
Fine quality, full grain pebble leather
</div>
Smooth Classic Napa leather construction
<br />
Lateral footprint with top access
<br />
Durable belt clip
<br />
Top flap with snap closure for added security
<br />
Soft velvet lining with light protective layer
<br />
Bottom push-through cutout for easy Motorola Droid removal
<br />
Simple Scandinavian rounded design
<br />
Sena craftsmanship and quality
<br />
</div>
【问题讨论】:
-
你能给我们完整的 HTML 输出(审查内容/在必要时排除图像),以便我们使用它吗?
标签: jquery firefox google-chrome