1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    14
    Vote Rating
    0
    sidthegooner is on a distinguished road

      0  

    Default Managed Iframe Firefox issue when content gets reloaded -- Urgenttttt

    Managed Iframe Firefox issue when content gets reloaded -- Urgenttttt


    Hi,
    I have a default src pointing out to a jsp...

    On the afterrender of the iframe panel, i have an array of image url's which i load on Timer tasks..Now the problem is domready fires every time the image has been refreshed in google chrome,but if there are
    totally three items in the array,it is decrementally missing out to fire the domready event for one of the items in the array...Eg : On first time load domready does not fire for the second item of the array,second time dies not fire for the first item and so on...Could be a silly issue..Any help is greatly appreciated...

    Thanks in advance
    Sid
    Code:
    if(streamedImgs.length>1){
    	var updateSrc = function(){
    		var img = streamedImgs[count];
    		var iframe = that.setSrc(img,false);
    		count = (count+1 == streamedImgs.length)?0:count+1;
    						
    	};
    	var task = {
    	    run: updateSrc,
    	    interval: 5000 //10 seconds
    	};
    	var runner = new Ext.util.TaskRunner();
    	runner.start(task);
    }
    Last edited by sidthegooner; 25 Sep 2013 at 8:59 AM. Reason: Indentation

  2. #2
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    @Sid:
    For the style of image rotation you are attempting (in-essence, a timer) you must account for the asynchronous nature of image 'loading'. A fixed 5/10 second timer will be hit-or-miss as you have no idea what the download size of the image IS or how long it will take any of the browsers to render it (depending on encoding).

    Better, would be to rely on the 'load' event of the MIF (which is only fired when all image assets, scripts, etc are fully loaded and initialized). Only then should you '.setSrc' for the next one.

    hope that helps
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


Thread Participants: 1

Tags for this Thread