jquery - html - css 检查 chrome、ie 和 firefox

标签 jquery html css

css 适用于 firefox 但不适用于 ie 或 chrome。如何修复 css,以便至少 IE 像 firefox 一样工作。

火狐:

enter image description here

IE:

enter image description here

图像也在背景中,但应该是透明的。

Chrome:

enter image description here

HTML:

<center><div id="slideshowContentArea" style="display:none; width:500px; height:300px">
    <div class='nav'><a id='prev' href='#'>Prev</a>&nbsp&nbsp<a id='next' href='#'>Next</a></div> 
    <div id="slideshow" class="pics" style="position: relative; overflow-x: hidden; overflow-y: hidden; height:250px; width:395px">&nbsp;</div>
</div></center>

        $('#slideshow').cycle(
            { fx: 'fade', timeout: 3000, speed: 500, 
              pager: '#slideshow', before: setBGBefore, prev:'#prev',next:'#next',after:onAfter
            }
            );
        function setBGBefore() {
        $(this).css({ 'background-image': 'url(' + $(this).find('img').attr('src') + ')', 
        'background-position': 'center top', 'background-color': 'transparent' });
        $(".welcomeBox div").html($(this).find('span').html());
        }

最佳答案

jQuery 可以告诉您正在使用的浏览器:

http://api.jquery.com/jQuery.browser/

更新。 问题标题是“check for chrome, ie & firefox”,这就是我回答的内容。如果他希望实现更优雅的解决方案,则取决于 OP。

关于jquery - html - css 检查 chrome、ie 和 firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6204218/

相关文章:

html - 如何使用 Bootstrap 在 Web 中自动展开元素?

jquery - 以速度循环/重新启动动画,无需反向播放

jquery - 如何动态重置表格宽度 - 数据表?

html - 为什么 CSS 左右边距会增加元素的大小?

javascript - 关闭子页面后无法重新加载页面

css - 绝对定位的下拉菜单在 IE 中不同

css - 表情符号在 IOS 7 上不会超过 16px 字体大小

jquery;click函数循环遍历<li><img>

jquery - 自定义 jQuery UI 对话框样式

html - 实现 facebook 相似图像封面