asp.net IE下div背景图片100%拉伸填充,可以缩放

简介: 看到CSDN上有人提问,就简单做了个,仅在IE下测试可用,其它浏览器未测试! $(function () { $(window).

看到CSDN上有人提问,就简单做了个,仅在IE下测试可用,其它浏览器未测试!


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $(window).resize(function () {
                var width = $(this).width();
                var height = $(this).height();
                $("#div1").height(height - 30);
                $("#div1").width(width - 10);
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="div1" style="filter: progid:dximagetransform.microsoft.alphaimageloader(src='Images/sms_logo.png', sizingmethod='scale');">
    </div>
    </form>
</body>
</html>


相关文章
|
Web App开发 前端开发 JavaScript
简单的鼠标可拖动div 兼容IE/FF
来源:http://www.cnblogs.com/imwtr/p/4355416.html 作者: 主要思路: 一个div,注册监听onmousedown事件,然后处理获取的对象及其相关值(对象高度,clientX/clientY位置等) 并继而转为监测onmousemove事件,在鼠标移动事件中更新div对象的位置属性 鼠标松开的时候解除监听,更新位置完成。
982 0
IE DIV背景透明,点击事件不响应解决方案
IE DIV背景透明,给DIV绑定点击事件,   $("div").bind("click", function(){ alert('click me.'); });     当点击DIV时,不会响应已经绑定的点击事件。
891 0