in my job (intranet)- I have an aspx page which has many Iframes ( all ours).
each iframe is being set(js/jquery) by btnX ( there are many buttons in the aspx page... some set src to iframes - some not).
notice : the progrssBAr is on the main page...
goal : progressBar while iframe is loading...
code :
( at first the myPageWrapper
is display:none
)
$('#myPageWrapper').on ('load','iframe',function () { $("#myProgressBar").hide();});
2 problems :
- i can listen to the iframes load finish event. but what about
showing
the ProgfressBar ?
i dont want to edit all btn's event "onclick" - is there any centralized solution to this [using jquery]?
i need something that does :
"when btn sets the src
to an iframe - show myProgressBar
"
- simultaneous events can occur : iframe A is being loading for 2 min ( example) - so it shows the progress bar , meanwhile i pressed other button which sets
src
to iframe B - which is loading very fast... once its loaded - it hides the ProgressBar ( look at my code) - but it shouldnt...A didnt finish yet....
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…