Michael Sterling
asked on
My .gif won't show, why?
I'm wanting to show a .gif while some processing goes on in the background, but I'm not able to get it to show, not even sure if it will 'animate', but I'm gonna hope for the best, once I can get it to show.
In my master page I have this:
in my child page I have this:
The .gif does exist in the Images folders. It does freeze the window/screen (except for the vertical scroll bar on the right), but the .gif doesn't show. What am I missing/doing wrong? Or are there other examples of how to make a .gif function properly? If so can you provide code and or links?
In my master page I have this:
<style type="text/css">
.lnkBtnTFBlue {
display: none;
}
.LockOff {
display: none;
visibility: hidden;
}
.LockOn {
font: arial;
font-size: xx-large;
font-weight: bolder;
display: block;
visibility: visible;
position: absolute;
z-index: 50000;
top: 0px;
left: 0px;
width: 105%;
height: 105%;
background-color: #CCC;
text-align: center;
padding-top: 20%;
filter: alpha(opacity=75);
opacity: 1.5;
}
</style>
<script type="text/javascript">
$(document).ready(function (jQuery) {
function LockScreen(str) {
var lock = document.getElementById('LockPane');
if (lock)
lock.className = 'LockOn';
if (str != '') {
lock.innerHTML = str;
}
}
});
</script>
.
.
.
</form>
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/response.min.js"></script>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="js/global.js"></script>
</body>
</html>
in my child page I have this:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<script src="js/maskedinput.js"></script>
<script src="js/jquery.maskMoney.min.js"></script>
<script src="js/jquery-ui-1.11.3.js"></script>
<script src="js/jquery-1.11.2.min.js"></script>
.
.
.
<div class="row">
<div class="col-xs-12 center">
<asp:Button runat="server" CssClass="btn center-block hidden-print" BackColor="Red"
ForeColor="White" ID="btnSave" Text="SAVE" OnClick="btnSave_Click"
OnClientClick="var b = confirm('GENERATING REPO DOCUMENTS!! THIS WILL TAKE A COUPLE OF MINUTES. YOU WILL BE REDIRECTED WHEN THIS PROCESS FINISHES.'); if (b) LockScreen('GENERATING REPO DOCUMENTS...');"></asp:Button>
</div>
</div>
<div id="LockPane" class="LockOff" runat="server">
<img src="Images/Loader.gif" alt="Generating documents ......" />
</div>
</asp:Content>
The .gif does exist in the Images folders. It does freeze the window/screen (except for the vertical scroll bar on the right), but the .gif doesn't show. What am I missing/doing wrong? Or are there other examples of how to make a .gif function properly? If so can you provide code and or links?
ASKER
Hain
I was able to use the Chrome browser tools to step through the function. The problem seems to be that it is not grabbing/identifying my control. I tried three different ways to identify the control and none of them worked. When I tried your code it told me that the str variable was undefined as well as it also couldn't find my control. Help?
I was able to use the Chrome browser tools to step through the function. The problem seems to be that it is not grabbing/identifying my control. I tried three different ways to identify the control and none of them worked. When I tried your code it told me that the str variable was undefined as well as it also couldn't find my control. Help?
ASKER
Hain
I forgot to mention that the function was found to be undefined whenever I put it inside the document ready block:
I forgot to mention that the function was found to be undefined whenever I put it inside the document ready block:
<script type="text/javascript">
//debugger
//PHONE INPUT MASK
$(document).ready(function (jQuery) {
$(".inputField").bind('keyup', function (e) {
if (e.which >= 97 && e.which <= 122) {
var newKey = e.which - 32;
e.keyCode = newKey;
e.charCode = newKey;
}
$(this).val(($(this).val()).toUpperCase());
});
function LockScreen(str) {
$("#LockPane").addClass("LockOn").append("<div>" + str + "</div>")
var lock = document.getElementById('LockPane');
}
LockScreen(str);
});
//function LockScreen(str) {
// var lock = document.getElementById("[id$='LockPane']");
// if (lock)
// lock.className = 'LockOn';
// if (str != '') {
// lock.innerHTML = str;
// }
//}
</script>
move this
to line 3/4, before jquery dom function
function LockScreen(str) {
$("#LockPane").addClass("LockOn").append("<div>" + str + "</div>")
var lock = document.getElementById('LockPane');
}
to line 3/4, before jquery dom function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help.
https://jsfiddle.net/HainKurt/h0nyp0tg/
is this what you are trying to do?
just used
Open in new window
maybe your issue was this:
Open in new window
you get rid of all elements and just replace content with that text!