Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 为超大图像的元素指定固定位置_Jquery_Css_Position - Fatal编程技术网

Jquery 为超大图像的元素指定固定位置

Jquery 为超大图像的元素指定固定位置,jquery,css,position,Jquery,Css,Position,如果我有一个超大的图像,并且我想将一个元素锚定到该图像上,使其仅在您平移/扫描该图像部分时显示,该怎么办 HTML: 我使用touchpanview()来实现平移和扫描 任何指导/建议都会有帮助。在您链接的页面上,“带图钉的地图”示例是否与您正在尝试的类似?是的,有点——我希望元素只有在您平移到该部分时才会出现。最后,我放弃了这种方法,改为使用“可拖动”。 <img id="map" src="images/big_image.jpg" alt="xxx" width="2160" hei

如果我有一个超大的图像,并且我想将一个元素锚定到该图像上,使其仅在您平移/扫描该图像部分时显示,该怎么办

HTML:

我使用touchpanview()来实现平移和扫描


任何指导/建议都会有帮助。

在您链接的页面上,“带图钉的地图”示例是否与您正在尝试的类似?是的,有点——我希望元素只有在您平移到该部分时才会出现。最后,我放弃了这种方法,改为使用“可拖动”。
<img id="map" src="images/big_image.jpg" alt="xxx" width="2160" height="589"/>
<div id="small_image" class="bridge"></div>
#map {

 border-bottom: 1px solid gray;
 border-top: 1px solid gray;
 overflow:hidden;
 position:relative;
 left:0;
 top: 0;
 z-index:1;

}

.bridge {
    position: absolute;
    width:50px;
    height:50px;
    cursor:pointer;
    z-index:10; 
    border: 5px solid white;
}

#small_image {

    top: 10px;
    left: 10px;
    background-image:url('images/small_image.jpg');

}