I have this simple blade.php
with the following code:
<script type="javascript">
$("#loading-button").click(
function () {
$("#loading-overlay").show();
}
);
</script>
<style type="text/css">
#loading-screen {
background: url({{asset('storage/loading.gif')}}) center center no-repeat;
height: 100%;
z-index: 20;
}
#loading-overlay {
background: #e9e9e9;
display: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.5;
}
</style>
<div id="loading-overlay">
<div id="loading-screen"> LOADING... </div>
</div>
In the other layout, I am loding jquery-3.2.1 and in my main page I am extending the main layout (where jquery is loaded) and including the loading
layout from above. The page source looks like this after rendering (Chrome page source):
<script type="javascript">
$("#loading-button").click(
function () {
$("#loading-overlay").show();
}
);
</script>
<style type="text/css">
#loading-screen {
background: url(http://localhost:8000/storage/loading.gif) center center no-repeat;
height: 100%;
z-index: 20;
}
#loading-overlay {
background: #e9e9e9;
display: none;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.5;
}
</style>
<div id="loading-overlay">
<div id="loading-screen"> LOADING... </div>
</div>
<button id="loading-button">TEST</button>
If I copy paste the code in JSFiddle
, it works. It doesn't have the image, but that is not relevant, as it is stored locally, but the overlay displays as expected.
The main layout has this in it:
<script src="http://localhost:8000/js/jquery-3.2.1.min.js"></script>
<script src="http://localhost:8000/js/bootstrap.min.js"></script>
CONSOLE ERROR:
bootstrap.min.js:7 Uncaught Error: Bootstrap tooltips require Tether (http://tether.io/)
at bootstrap.min.js:7
at bootstrap.min.js:7
at bootstrap.min.js:7