PDA

View Full Version : [Solved]how to fire after images are loaded



ht8206
2 Jan 2008, 1:51 AM
I want to know how to execute Ext.Resizable after images are loaded?
this is my code ,but onDocumentReady Fires before images are loaded.Have can I resolve it ?


<script type="text/javascript">

var availPage = function(){
return{
init:function(){
var wrapped = new Ext.Resizable('wrapped', {
wrap:true,
pinned:true,
minWidth:50,
minHeight: 50,
preserveRatio: true,
dynamic:true,
handles: 'all',
draggable:true
});

}
};
}();

Ext.EventManager.onDocumentReady(availPage.init,availPage,true);
</script>

</head>

<body>
<% String slice=(String)request.getAttribute("slice");
int end=slice.indexOf('.');
slice=slice.substring(0,end);
System.out.println(slice);
%>

<div style="position:absolute;height:600px; width:1000px; overflow: auto; top:50px; overflow:hidden;">

<img id="wrapped" src="<%=basePath%>sys/imageview.action?slicepath=<%=slice%>" style="position:relative;left:0;width:300;z-index=200"/>
</div>
<%=request.getAttribute("photo") %><br>
</body>

webg
3 Jan 2008, 9:09 AM
I don't know of any native support in EXT but here is a function I found on the nets

http://www.webscriptexpert.com/Javascript/check%20if%20all%20the%20images%20have%20been%20loaded/

webg

hendricd
3 Jan 2008, 9:26 AM
The window.load event is fired when all img, and script modules have been completely loaded by their respective containers.

Ext.onReady fires when the DOM is established/queriable (but assets not fully loaded/rendered).

ht8206
3 Jan 2008, 9:51 PM
I used window.load, question resolved.Thank you ,and Happy new year