Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.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 等待加载SharePoint Web部件-时间问题_Jquery_Sharepoint_Sharepoint 2007_Web Parts - Fatal编程技术网

Jquery 等待加载SharePoint Web部件-时间问题

Jquery 等待加载SharePoint Web部件-时间问题,jquery,sharepoint,sharepoint-2007,web-parts,Jquery,Sharepoint,Sharepoint 2007,Web Parts,在同一个SharePoint 2007站点中加载几个Web部件时,我遇到了时间问题 目前我在我的网站上有几个网页,都是垂直对齐的。我希望最后加载最底部的Web部件,因为它有一个组件,该组件将被呈现以执行jQuery.offset.top,该组件在执行代码时获取组件的左上角位置。当前,每次我重新加载页面时,组件都出现在错误的位置。只有当上面没有其他Web部件时,它才会位于正确的位置 例如: WebPartWithComponent页面上的第一个组件: WebPartWithComponent &l

在同一个SharePoint 2007站点中加载几个Web部件时,我遇到了时间问题

目前我在我的网站上有几个网页,都是垂直对齐的。我希望最后加载最底部的Web部件,因为它有一个组件,该组件将被呈现以执行jQuery.offset.top,该组件在执行代码时获取组件的左上角位置。当前,每次我重新加载页面时,组件都出现在错误的位置。只有当上面没有其他Web部件时,它才会位于正确的位置

例如:

WebPartWithComponent页面上的第一个组件:

WebPartWithComponent <-- component rendered here correctly.
WebPart1
WebPart2
WebPart3
Webpart1
Webpart2 <-- component rendered here instead.
WebpartWithComponent <-- this is where the component should be rendered
Webpart4
页面上有组件的Web部件前面的其他Web部件:

WebPartWithComponent <-- component rendered here correctly.
WebPart1
WebPart2
WebPart3
Webpart1
Webpart2 <-- component rendered here instead.
WebpartWithComponent <-- this is where the component should be rendered
Webpart4
是否有任何方法可以确保最后加载包含组件的Web部件,或在其他Web部件完成加载时开始加载,或在代码中的特定点等待,直到其他Web部件完成加载

Web部件在jQuery js文件中呈现


谢谢。

您能在上一个web部件中使用jQuery ready函数吗

或者,如果有,请在web部件中设置某种跟踪阵列:

if(typeof(gWebParts)=="undefined") {
gWebParts = new Array()
}
gWebParts[gWebParts.length] = someobject
然后,当它们加载后,设置一些变量

gWebParts[i].loaded = true
在您的最后一个Web部件中,设置计时器

setInterval(function() {
   if(gWebParts all loaded) {
      clearInterval()
      //do your stuff
   }
}, 250)