使用jQuery在不同屏幕分辨率上的热图 [英] Heat Map on different screen resolution using jquery

查看:81
本文介绍了使用jQuery在不同屏幕分辨率上的热图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了Chris Coyier的文章( http ://css-tricks.com/tracking-clicks-building-a-clickmap-with-php-and-jquery/).它显示了如何跟踪整个页面的用户点击,如何将其保存到数据库中以及随后如何利用该页面构建热图.

I read Chris Coyier article ( http://css-tricks.com/tracking-clicks-building-a-clickmap-with-php-and-jquery/ ) . It shows how to track user clicks through out a page , save it to a database and later build a heat map out of it.

使用固定的屏幕分辨率可以正常工作,但是如果失败,我立即调整窗口大小即可.

No problems with that it works fine with a fix screen resolution but the moment i resize the window if fails.

假设我要跟踪整个网站的点击情况,不同屏幕分辨率之间会发生什么,因此,假设用户的屏幕分辨率为1024×768,另一个来自桌面的用户分辨率为1024×640,还有一个通过手机.

Let's say i want to track clicks for my entire website , what will happen between different screen resolutions , so let's say a user is on 1024×768 screen resolution , the other one from desktop again is on 1024×640 and one more from a mobile phone.

最后,我使用完全不同的屏幕分辨率(例如1280×720)查看我的网站报告.会不会造成混乱?

At last i am looking at my website report using a totally different screen resolution let's say 1280×720. Isn't it going to create a mess.

想知道是否有任何修复方法吗?

Would love to hear if there is any fix on it or not ?

推荐答案

您可以使用特定的固定分辨率(例如1024 x 768)实现此目的.如果调整了窗口的大小,则需要重新计算宽度和高度,然后尝试将缩放位置缩放"回固定的1024 x 768设计.这不会100%准确,但是会为您带来不错的结果.

You could implement this with a particular fixed resolution (say 1024 x 768 ). If the window is resized, you would then need to recalculate the width and the height, and then try and 'scale' the clciked position back to your fixed 1024 x 768 design. This will not be 100% accurate, but it will give you decent results.

这篇关于使用jQuery在不同屏幕分辨率上的热图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆