且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

显示使用AJAX获取的数据时出现问题

更新时间:2022-04-08 10:28:29

你可以尝试在img之后检索图像的''像素位置''(计算样式)渲染并使用scrollTo()方法...但我只是想知道为什么锚解决方案不起作用?你是怎么试过的?


亲切的问候
you could try to retrieve the ''pixel-position'' (computed style) of the image after the img was rendered and use the scrollTo() method ... but i just wonder why the anchor-solution was not working? how have you tried that?

kind regards


我首先在空白的< td>中显示页面。然后调用用正确的照片填充它的函数,所以我猜对于通过AJAX检索的锚点
I first diplay the page with empty the <td> and then call the function which populates it with the right photos so I guess will not work for an anchor retrieved through AJAX


,当页面完全加载并且你要检索的元素是渲染到dom-tree然后你应该能够检索文档中的presnet节点...这意味着你甚至可以在加载任何图像等之前添加锚点但是你应该调用应该滚动页面的方法后!当你想使用dom-methods来检索任何节点时,所有图像和相关的dom节点都被完全加载。


亲切的问候
when the page is fully loaded and the elements that you want to retrieve are rendered to the dom-tree then you should be able to retrieve any node that is presnet in the document ... that means you could even add the anchor before loading any images etc. but you just should call the method that should scroll the page after! all images and relevant dom-nodes are fully loaded when you want to use dom-methods to retrieve any nodes.

kind regards