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....
CODE UPDATED
since i received 3 up-votes i assume that this code is helping someone else other then the original OP; so i decided to update the code to reflect what it was meant to be at the beginning, since so far the OP and i have discovered that his problem was somewhere else in his code.head of main page
bottom of main page:
bottom of each iframe page: