简体   繁体   English

页面上的用户交互与醉意

[英]User interaction on a page with tipsy

Is there a way I can trace what the user does on the page. 有没有办法可以跟踪用户在页面上执行的操作。 Mainly I want to do the following thing: User opens a page, if he does not click anywhere on that page to show a tooltip (i'm using tipsy) guiding him which parts are clickable. 主要是我想做以下事情:用户打开一个页面,如果他没有点击该页面上的任何地方来显示工具提示(我正在使用tipsy)指导他哪些部分是可点击的。

So far I've tried several stuffs: 到目前为止,我已经尝试过几种东西:

  1. I have set tipsy to show manually: trigger : manual ; 我已经设置了手动显示的tipsy: triggermanual ;
  2. I made a variable that equals false until the user clicks those clickable items (divs and images) 我做了一个等于false的变量,直到用户点击那些可点击的项目(div和图像)
  3. If the variable is false, show the tooltip ( tipsy ). 如果变量为false,则显示工具提示( tipsy )。

But I'm missing something because this doesn't work. 但我错过了一些东西,因为这不起作用。 Here is my code. 这是我的代码。

$(document).ready(function() {
    var userClick = false;

    function showTooltips() {
        $(document).ready(function()) {
            if(userClick === false)
                $('.nickname .pseudo-white').tipsy('show');
    }

    setTimeout(showTooltips(), 5000);
});

Try getting rid of the extra call to $(document).ready, and pass the function name to setTimeout rather than calling it with () 尝试摆脱对$(document).ready的额外调用,并将函数名称传递给setTimeout而不是用()调用它

$(document).ready(function() {
    var userClick = false;

    function showTooltips() {
            if(userClick === false)
                $('.nickname .pseudo-white').tipsy('show');
    }

    setTimeout(showTooltips, 5000);
});

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

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