English 中文(简体)
我怎么能用 j子正确抹去比集装箱更大的图像?
原标题:How can I pan an image larger than its container correctly using jQuery?

我制造了相当高的冷静图像探测器,但在某个特定部分被困:当zo时,图像被抹去。 这似乎是一个棘手的问题,我尝试对关于SO的类似问题作出大量答复,但每次都只是工作权。 我需要一种新的眼睛。

我先在我的服务器上暂时开放了URL。 查阅网页:

[结束]

其次,把烟轮推向浮游动物。 这里我们就是这样。 一旦zo到、点击和拖拉,以尝试和抹杀图像。 它正在扩大alright,但是一种权利。 这是目前用于扩大的法典:

var clicking = false;
var previousX;
var previousY;

$("#bigimage").mousedown(function(e) {

    e.preventDefault();
    previousX = e.clientX;
    previousY = e.clientY;
    clicking = true;
});

$(document).mouseup(function() {
    clicking = false;
});

$("#bigimage").mousemove(function(e) {

    if (clicking) {
        e.preventDefault();
        var directionX = (previousX - e.clientX) > 0 ? 1 : -1;
        var directionY = (previousY - e.clientY) > 0 ? 1 : -1;
        $("#bigimage").scrollLeft($("#bigimage").scrollLeft() + 10 * directionX);
        $("#bigimage").scrollTop($("#bigimage").scrollTop() + 10 * directionY);
        previousX = e.clientX;
        previousY = e.clientY;
    }
});

解决办法I m 着眼于这些特点:

  • Correct direction of panning over the X and Y axis
  • It should not be possible to pan outside the edges of the image
  • Reasonably fluent panning
  • Nice to have: window resize should not cause any issues

尽管我感谢我能够提供的任何帮助,但请不要把我指向一个通用的假胜地,但我已尝试过其中太多的人,我正在寻找一个针对我具体情况的答案。 我如此绝望,甚至为符合上述特征的完美解决办法提供了一笔钱。

www.un.org/Depts/DGACM/index_french.htm 请在“D”或“Webkit browser”中尝试链接。

最佳回答

我把我所希望的那支支支.子聚集在一起。

它符合所有四项标准。 让我知道,我是否误解了你的预期结果。

问题回答

i 你们的工作有一些替代gin。 在这些杂草中试。

http://kvcodes.com/4002/jquery-plugins-for-containerdiv-zoom/





相关问题
Using QCView and iSight to capture image

I have a QCView that loads a Quartz file which gives you iSights feedback (basically like a QTCaptureView) Everything displays fine The button simply takes a snapshot using the following simple ...

Taking picture with QTCaptureView

Is it possible to simply take a picture and save it somewhere using a QTCaptureView and Apple s built-in iSight? I ve seen lots of tutorials on recording video but none on simply taking a picture. Any ...

Transform rectangular image into trapezoid

In .NET how can I transform an image into a trapezoid. The Matrix class supports rotation, shear, etc, but I can t see a trapezoidal transformation. I m using the usual System.Drawing.* API, but I m ...

Rotate image through Y-axis on web page

What are my options for rotating an image on a web page through the Y-axis? I m not sure if I even have the terminology right. Is this called a rotate or a transform. Most of the searches that I ve ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

Convert from 32-BPP to 8-BPP Indexed (C#)

I need to take a full color JPG Image and remap it s colors to a Indexed palette. The palette will consist of specific colors populated from a database. I need to map each color of the image to it s "...

热门标签