我有一个在 IE9 和 Firefox 中运行良好的 javascript,但在 Chrome 中却不行。我需要一些建议来解决这个问题。
我正在尝试一个很酷的技巧来圆我从 http://www.bram.us/sandbox/roundedcorners/ 中学到的图像的 Angular 落.我更新了我的 css 并包含了上面网站中的 javascript,但实际上所有图像在 Chrome 上都消失了,而其他两个浏览器按预期呈现圆 Angular 。
我知道这个脚本也适用于 Chrome,因为 http://www.bram.us/sandbox/roundedcorners/在 Chrome 上运行良好。
这是javascript。
jQuery(function($) {
$('img').wrap(function() {
return '<span style="background-image:url(' + $(this).attr('src') + '); height: '+ $(this).height() + 'px; width: '+ $(this).width() + 'px;" class="rounded" />';
});
});
提前致谢!
最佳答案
您确定没有忘记在 .rounded
类的 CSS 中包含这些内容吗?
-webkit-border-radius
边界半径
display: block
或 display:inline-block
关于用于在 Chrome 上不起作用的圆 Angular 图像的 Javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10787827/