confirm选择及标题跑马的

来源:互联网 发布:java web论坛 编辑:程序博客网 时间:2024/04/28 04:32

function bodyOnClick() {
            alert("2012");
            alert("快来吧");
        }
        function f1() {
            window.alert('f1');
        }
        function f2() {
            alert("f2");
        }

        function confirmDemo() {
            if (confirm("确定删除")) {
                alert("ok");
            }else{
                alert("cancel");
            }
        }

 

navigate导航              setinterval定时器

<script type="text/javascript">
        function transfer() {
            window.navigate("1-事件.htm");
        }
        var tid = window.setInterval("alert('hello')", 500);
    </script>

 

标题跑马灯

        function scroll() {
            var title = window.document.title;
            if (dir == "left") {
                var first = title.charAt(0);  //截取第一个字符串
                var last = title.substring(1, title.length); //截取除第一个字符的所有字符串
            } else if (dir == "right") {
                var last = title.charAt(title.length - 1);
                var first = title.substring(0, title.length - 1);
            }
            window.document.title = last + first;
        }
        var i = setInterval("scroll()", 500);
        //设置左右
        function setDir(str) {
            dir = str;
        }

 

window.showModalDialog("1-.htm");
       
        function showDialog() {
            window.showModalDialog("1-.htm");
        }
        function show() {
            window.showModelessDialog("1-.htm");
        }

 

<input type="button" value="模式窗口" onclick="showDialog()" />
    <input type="button" value="非模式窗口" onclick="show()" />

原创粉丝点击