问题标签 [panning]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
743 浏览

jquery - JQuery无限水平背景图像平移

好的,所以我有一张我想用作背景的图像,但让它像下图一样滚动。

任何人都可以帮助我解决这个问题或将我链接到正确的方向吗?希望不是视差,除非你能帮助我了解如何实现这种效果。我也没有要求任何人为我做这件事,我只是需要一些指导。

没关系,在从搜索中发布此内容后可能连续搜索了 3 个小时,但没有找到我正在寻找的东西,我终于找到了我想要实现的目标。如果其他人需要此结帐的帮助,请查看站点 - http://www.creativejuiz.fr/blog/doc/infinite-slideshow/

http://imageshack.us/scaled/landing/191/slideshowmain.gif

0 投票
1 回答
2524 浏览

jquery - jQuery Flot time-based axis panning issue

I've been tinkering, making a little chart with Flot and some of it's plugins. The purpose is to provide a chart tracking basal body temperature, with the date per day on the x axis, degrees on the y axis. Panning will shift the x axis, so you can see previous dates etc, clicking will result in a new point, snapped to grid.

The grid on a time based axis when panning does not move. It does when I change the axis type to normal. I really want to have the entire grid move, because now the line series sort of 'floats around' on the grid. Does anyone know how to make that work? Am I missing something in the options?

This is harder to explain than it is to see, so fsfiddle provided: http://jsfiddle.net/jorgthuijls/caM3q/1/

Triggering the change in behaviour is the option mode: 'time' on the x axis option (line 24 of the fiddle).

The bit of code to pay attention to:

change this to

and see what happens moving the graph after adding a few points.

Much appreciated!

0 投票
1 回答
67 浏览

raphael - 在 IE 和 FF 中平移 Raphael 曲面/元素很慢并且会中断

我正在使用 Raphael 插件并绘制几个矩形并在它们之间创建一些连接,使它们看起来像圆形/连接图。

当我开始从其初始位置移动矩形时,它将随着鼠标指针的移动而移动。这是在 Chrome 浏览器中。

当我在 Firefox(20.xx) 和 Internet Explorer(8) 浏览器中测试相同的功能时,速度很慢,有时使用鼠标指针拖动矩形时矩形会破裂。

特别是在 Internet Explorer(8) 浏览器中速度非常慢,有时鼠标指针会在 x 位置,而拖动的矩形会在其他位置。

我不希望使用 Raphael-zpd.js 插件一次移动整个图形。我想知道为什么两个浏览器的功能不同。

有没有办法解决 Raphael 的跨浏览器问题?我试图找到有关拉斐尔这种特殊行为的更多信息,但我找不到任何信息。

提前致谢。

0 投票
1 回答
356 浏览

charts - Wavemaker using MouseZoomAndPan

In wavemaker a got an app that display charts with dojo charting, some charts have a lot data so the chart is compressed so i look around and found that we could add zooming and panning, found an example on the web link:http://informatik.fh-brandenburg.de/~porebskk/dojo.html

i look at the source code and it looks like i only had to add this to my code

dojo.require("dojox.charting.action2d.MouseZoomAndPan");

and then call it before rendering the chart

new dojox.charting.action2d.MouseZoomAndPan(chart, "default");

My problem is when i had this to my source code dojo.require("dojox.charting.action2d.MouseZoomAndPan");

and run the app i get "page Main as error" and my application does not work anymore

if i do this then my application comesback to life //dojo.require("dojox.charting.action2d.MouseZoomAndPan");

i create a new application and i only had this on top of the main page and get the error again dojo.require("dojox.charting.action2d.MouseZoomAndPan");

in the wavemaker debugger i get "error parsing pages/Main/Main.js"

0 投票
1 回答
675 浏览

google-maps-api-3 - Google Maps API v3 平移和指南针控制失败

这张地图用一个奇怪的白色碎片代替了平移/罗盘控件(左上角)。它在鼠标悬停时消失并在鼠标移出时返回。

此处提供屏幕截图:http: //i.stack.imgur.com/52037.jpg

关于为什么会发生这种情况的任何想法?永远感谢您的指导。

交流电

(在上下文中,http://www.whiskyfair.com.au/209/

0 投票
2 回答
668 浏览

c# - C# - 最适合创建 PictureBox 的设计模式支持:平移/缩放/可滚动和选择工具(可拖动矩形)

我想创建一个派生的 PictureBox 类,支持缩放、平移、滚动功能和一些选择工具(圆形、矩形、环形)。

我想知道我应该使用哪种设计模式(我只是考虑一个用于进行撤消/重做的命令模式)以及一些关于开始正确设计我的控件的建议。

0 投票
0 回答
1502 浏览

android - 发生缩放后获取点击的 (x,y) 坐标

我有一个自定义视图,它本质上是一个绘制在画布上的网格,为此我实现了平移和缩放。这些工作正常,但我也希望能够找到点击的网格坐标。

为了做到这一点,我必须同时补偿视图被平移的量,以及它被缩放/缩放的量。这就是我遇到的麻烦。

为了补偿它被平移的数量,我跟踪所有发生在PointF dspl. 在onTouchEvent(MotionEvent event)我的自定义视图的方法中,我打开event.getAction() & MotionEvent.ACTION_MASK并在这种情况下MotionEvent.ACTION_DOWN设置事件的起点以及起始位移和其他一些不言自明的事情:

然后在这种情况下,MotionEvent.ACTION_UP我执行以下操作:

最后是我获得坐标的方法:

(这scaleFactor是视图整体缩放的量)。正如我预期的那样,此方法不适用于平移,而且我不知道如何修改它以正确考虑缩放。

我非常感谢任何帮助,因为我已经为此苦苦挣扎了很长时间,是的,我知道这个问题,这与我想做的有点不同。

谢谢!

0 投票
0 回答
569 浏览

javascript - 如何使用缩放行为在 D3 中缩放 + 平移椭圆

我最近基于 D3 示例http://bl.ocks.org/mbostock/3680957应用了平移 + 缩放

这适用于多边形、线条、圆形,但不适用于椭圆。当我平移 + 缩放椭圆并缩放 rx 和 ry 值时,新的 rx/ry 值不会像我预期的那样改变。椭圆极大地重塑,有时甚至消失(rx/ry 变为负数)。

我在网上查看了其他类似的示例,它们也不适用于省略号。

这是一个 JSFiddle 示例http://jsfiddle.net/44VYK/

我不认为这是 D3 的问题,我的直觉说我错过了示例和 D3 的缩放行为的一些基本内容。

如果有人可以帮助并澄清我错过的内容,将不胜感激。我怀疑这是一个简单的疏忽,但我被踩了。

这是 jsFiddle 代码:

0 投票
2 回答
1598 浏览

javafx-2 - JavaFX ScrollPane:禁用触摸事件的平移

我有一个 ScrollPane 的问题。我想禁用平移。对于鼠标来说,由于 setPannaable(boolean) 函数,这非常容易。但这不会禁用触摸事件的平移。那么有没有办法在 ScrollPane 中禁用触摸事件的平移?

谢谢你的帮助。

0 投票
1 回答
363 浏览

javascript - 平移后谷歌地图覆盖不正确

我在谷歌地图上放置了一个覆盖热图。更具体地说,我正在使用这个插件: http: //www.patrick-wied.at/static/heatmapjs/example-heatmap-googlemaps.html

现在,我的实现与演示略有不同,因为每次发生变化时我都会更新地图,因此

google.maps.event.addListenerOnce(map, 'idle', function(event){ updateHeatMap();});

变成:

google.maps.event.addListener(map, 'idle', function(event){ updateHeatMap();});

虽然缩放和平移应该刷新,但我注意到每当我拖动地图时,覆盖“颜色”移动的距离是地图移动距离的两倍。另一方面,缩放效果很好,因此放大和缩小可以再次校正位置。

仅当idle触发事件时刷新数据时才会发生这种情况。该演示工作正常,因为它只加载一次地图,与我的实现不同。

我怀疑以下代码有问题,但我没有设法检测到实际问题。

HeatmapOverlay.prototype.setDataSet = function(data){

我.latlgs = [];

我会很感激你的见解,因为我现在已经浪费了太多时间来解决这个问题......

非常感谢,真的很感激!