AspNet技术

.Net平台 + C#语言 + Microsoft SQL Server 开发互联网之web应用!

[原]层的右浮动

window.onload = function () {
            document.getElementById('btn').onclick = function () {
                //document.getElementById('dv').style.styleFloat = 'right';
                if (typeof ((document.getElementById('dv').style.styleFloat) == 'string')) {
                    document.getElementById('dv').style.styleFloat = 'right';
                } else {
                    document.getElementById('dv').style.cssFloat = 'right';
                };
            };
        };
<input type="button" name="name" value="层浮动" id="btn" />
    <div id="dv" style=" width:300px; height:200px; background-color:Green;">
    </div>

posted on 2014-04-26 22:21  Seves2015  阅读(105)  评论(0编辑  收藏  举报

导航