Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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
Html 然后页面div保持顶部/中间_Html_Css - Fatal编程技术网

Html 然后页面div保持顶部/中间

Html 然后页面div保持顶部/中间,html,css,Html,Css,我有一个ajax页面,在内容顶部像灯箱一样加载(一个包含很多产品的页面,假设高度=3000px) ajax页面具有动态高度,有时为500px,有时为2000px 点击一个产品(加载ajax页面):如果我使用position:absolute,然后点击页面末尾的某个产品,我就看不到ajax页面,因为页面太高了。 如果我使用position:fixed,ajax页面将保持在顶部(与我所处的位置无关),但是如果ajax页面的高度大于浏览器的高度,则我无法看到超出浏览器高度的ajax页面内容:( 希望这

我有一个ajax页面,在内容顶部像灯箱一样加载(一个包含很多产品的页面,假设高度=3000px)

ajax页面具有动态高度,有时为500px,有时为2000px

点击一个产品(加载ajax页面):如果我使用position:absolute,然后点击页面末尾的某个产品,我就看不到ajax页面,因为页面太高了。 如果我使用position:fixed,ajax页面将保持在顶部(与我所处的位置无关),但是如果ajax页面的高度大于浏览器的高度,则我无法看到超出浏览器高度的ajax页面内容:(

希望这有意义

当你点击图片时Pinterest如何加载内容是我想要的

谢谢!

太好了,我做完了

我必须使用:

#ajax { display:none; position: fixed; width: 100%; overflow-x:auto; overflow-y:scroll; z-index: 999999; top:0; left:0; right:0; bottom:0;  }
并调用ajax:

$(".product-list .quickview a").click(function(){
  $(this).closest("body").find("#ajax").load("ajax/product.html").show();
  $(this).closest("body").find(".whitebg").removeClass("hide");
  $(this).closest("body").css({ "overflow" : "hidden"});
})