繁体   English   中英

使用iframe加载HTML

[英]Body Load HTML with iframe

嗨,这是我的hmtl和JS,到目前为止,我希望它也可以检测iframe窗口中的鼠标移动,滚动和箭头,因为大多数网站都位于iframe中,所以我在其他地方查找,所有这些都似乎检测起来过于复杂运动。

任何帮助将不胜感激谢谢

<script type="text/javascript">
        // Set timeout variables.
        var timoutWarning = 1000; // Display warning in 1Mins.
        var timoutNow = 2000; // Timeout in 2 mins.

        var warningTimer;
        var timeoutTimer;

        // Start timers.
        function StartTimers() {
            warningTimer = setTimeout("IdleWarning()", timoutWarning);
            timeoutTimer = setTimeout("IdleTimeout()", timoutNow);
        }

        // Reset timers.
        function ResetTimers() {
            clearTimeout(warningTimer);
            clearTimeout(timeoutTimer);
            StartTimers();
            $("#timeout").dialog('close');
        }

        // Show idle timeout warning dialog.
        function IdleWarning() {
            var answer = confirm("Session About To Timeout\n\n       You will be automatically logged out.\n       Confirm to remain logged in.")
                if (answer){

                    ResetTimers();
                }
                else{
                    IdleTimeout();
                }
        }       

        // Logout the user and auto reload or use this window.open('http://www.YourPageAdress.com', '_self'); to auto load a page.
        function IdleTimeout() {
            window.open(self.location,'_top');
        }
    </script>

    <body onload="StartTimers();" onmousemove="ResetTimers();" onKeyPress="ResetTimers();"

就像是 *

 $(".in").on("mouseover",function(){ $(this).css("background","blue"); }); $(".in").on("mouseout",function(){ $(this).css("background","green"); }); 
 .in{width:50px;height:50px;background:red;} 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="in"></div> 

  • 并使用多个像这样的$("selector").on("mouseover mouseout mousemove",function(){ call back });

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM