logo
down
shadow

display loading image until all data gets loaded


display loading image until all data gets loaded

By : Waheedullah Ahmadi
Date : November 14 2020, 04:51 PM
With these it helps Right now i am simply giving a definite time interval after which the loading image disappears but i want to place a loading image which will be display until all the content in the background is not fully loaded. , Simple:
code :
spinner.show()
$.get('/api')
  .success(successCb)
  .fail(failCb)
  .always(function(){
    //...
    spinner.dismiss()
  })


Share : facebook icon twitter icon
Display Loading Image before a page gets loaded completely

Display Loading Image before a page gets loaded completely


By : statement
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further You should initially have the image showing in your HTML, and then hide it when the page loads, like this:
Javascript:
code :
window.onload = function() {
    document.getElementById('loadingImageIDHere').style.display = 'none';
};
How to display a loading image until a gridview is fully loaded without Ajax Toolkit?

How to display a loading image until a gridview is fully loaded without Ajax Toolkit?


By : SwagMoney
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further You can achieve this using jquery, there is a jquery block UI project on github and you could just use that one to block the grid view without using ajax.
here is the code you will need to do this, and it' tested and works fine like below:
code :
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <script src="http://malsup.github.io/jquery.blockUI.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#Button1').click(function () {
            $('.blockMe').block({
                message: 'Please wait...<br /><img src="Images/loadingBar.gif" />',
                css: { padding: '10px' }
            });
        });
    });
</script>
<asp:Button ID="Button1" runat="server" Text="Bind Grid View" 
            ClientIDMode="Static" OnClick="Button1_Click" />
    <div class="blockMe">
        <asp:GridView ID="GridView1" runat="server" Width="100%">
        </asp:GridView>
    </div>
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataTable tblCourse = myAccount.GetEnroledCourse("arpl4113");

        //Bind courses
        GridView1.DataSource = tblCourse;
        GridView1.DataBind();
    }
 <style> .hidden { display: none; } </style>
    <asp:HiddenField ID="hidTrigger" runat="server" ClientIDMode="Static" Value="" />
    <asp:Button ID="btnHidden" runat="server" ClientIDMode="Static" 
                OnClick="btnHidden_Click" CssClass="hidden" />
    <div class="blockMe">
        <asp:GridView ID="GridView1" runat="server"></asp:GridView>
    </div>
  <script type="text/javascript">
    $(document).ready(function () {

        //check whether the gridview has loaded
        if ($("#hidTrigger").val() != "fired") {

            //set the hidden field as fired to prevent multiple loading
            $("#hidTrigger").val("fired");

            //block the gridview area
            $('.blockMe').block({
                message: 'Please wait...<br /><img src="Images/loadingBar.gif" />',
                css: { padding: '10px' }
            });

            //fire the hidden button trigger
            $('#btnHidden').click();
        }
    });
</script>
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnHidden_Click(object sender, EventArgs e)
    {
        DataTable tblCourse = myAccount.GetEnroledCourse("arpl4113");

        //Bind courses
        GridView1.DataSource = tblCourse;
        GridView1.DataBind();
    }
UIPickerView won't display the data loaded from NSUserDefaults - App is crashing while loading data

UIPickerView won't display the data loaded from NSUserDefaults - App is crashing while loading data


By : user3087482
Date : March 29 2020, 07:55 AM
will help you The reason that your pickerViews are empty is most likely because you have not wired them up to viewController1 as dataSource and delegate. You can do this in the storyboard or in code:
code :
override  func viewDidLoad() {
    super.viewDidLoad()
    let pickers = [pickerView1,pickerView2,pickerView3]
    for i in 0...2 {
        let pickerView : UIPickerView = pickers[i]
        pickerView.dataSource = self
        pickerView.delegate = self
    }
}
 newMutableList.addObject(dataSet)
 var dataSet:NSMutableDictionary = NSMutableDictionary()
 dataSet.setObject(textField.text, forKey: "exercises")
return exercises[row] as String
 (ObjectiveC.UIPickerView, titleForRow : Swift.Int, forComponent:     
 Swift.Int) => Swift.ImplicitlyUnwrappedOptional<Swift.String>
        return exercises[row]["exercises"] as String
Want to display loading gif only when initial data are not loaded on page

Want to display loading gif only when initial data are not loaded on page


By : Rakesh
Date : March 29 2020, 07:55 AM
Does that help My answer is based on help provided by @MadeInDreams
Javascript (Lines with comments are added to resolve the issue)
code :
<script type="text/javascript">

$('.animation_image').show(); // show loading image initially when no data are loaded on page 

$(document).ready(function() {
var track_click = 0; 
var total_pages = <?php echo $total_review_pages; ?>;
var statepkid = <?php echo $int_statepkid; ?>;
var regionpkid = <?php echo $int_regionpkid; ?>;
$('#results').load("fetch_page.php", {'page':track_click, 'state':statepkid, 'region':regionpkid}, 
function() {
    track_click++;
    $('.animation_image').hide(); // Hide loading image when data are loaded initially
}); 

$(".load_more").click(function (e) {
    $(this).hide();
    $('.animation_image').show();
    if(track_click <= total_pages) 
    {
        $.post('fetch_pages.php',{'page': track_click, 'state':statepkid, 'region':regionpkid}, function(data) {
            $(".load_more").show(); 
            $('.animation_image').hide();
            $("#results").append(data);
            $("html, body").animate({scrollTop: $("#load_more_button").offset().top}, 500);
            $('.animation_image').hide();
            track_click++;
        }).fail(function(xhr, ajaxOptions, thrownError) {
            alert(thrownError);
            $(".load_more").show();
            $('.animation_image').hide();
        });
        if(track_click >= total_pages-1)number
        { $(".load_more").attr("disabled", "disabled"); }
     }
    });
});
</script>
<div class="animation_image"><img src="../images/ajax-loader.gif"> Loading...</div>
Loading image delayed display after loaded

Loading image delayed display after loaded


By : user1702830
Date : March 29 2020, 07:55 AM
Any of those help It might depend on the time the browser needs to render the image after the script loaded it.
I played a little with your fiddle and came up with this:
code :
$(function() {

    $("#base").css({opacity: 0});
    var baseHeight = $(window).height();
    var backLayerSRC = $('#img').attr('data-src');
    $('#base').height(baseHeight);

    var img = new Image();
    var imgWidth, imgHeight;

    img.onload = function() {
        imgHeight = this.height;
        imgWidth = this.width;

        var factor = 1 * baseHeight / imgHeight;
        totalWidth = Math.round(factor * imgWidth);

        currentWidth = totalWidth;
        $('#base').width(totalWidth);
        $('#img').attr('src', backLayerSRC);
        $('#img').height(baseHeight);

        $('#base').delay(1000).animate({opacity: 1.0},500);



    };

    img.src = backLayerSRC;

});
Related Posts Related Posts :
  • How to change add and remove active class in JavaScript
  • how to toggle a specific div in javascript
  • How to get all the values from multiple keys of an array of object?
  • jQuery bind() unbind() and on() and off()
  • regular expression to find DD Month YYYY from a string
  • How to upload files from web client (HTML/jQuery form) to your Dropbox folder
  • Backbone history and require.js issue
  • Confusion over Classical and Prototypal Inheritance Javascript
  • How to take screen shot of current webpage using Javascript/JQuery?
  • Store meridiem in a variable
  • class declared inside closure vs standard class without closure
  • javascript confirm box always return true
  • dynamically changing the size of font size based on text length using css and html
  • Node.js - Getting the host IP address while on Amazon EC2
  • Confusing CSS, can anyone explain please
  • How to install v8-profiler on Windows 8 (64 bit) using npm?
  • Resolve promise based on another promise
  • google maps adding overlay layer above UI and markers
  • Style specific letter?
  • RangeError: Maximum call stack size exceeded with array.slice
  • node rest client get with local variable
  • If condition not executes while mouse move fastly
  • Count the number of displayed elements in a HTML list
  • Locate JavaScript source code in Emacs
  • Clean, Modular Code vs MV* Frameworks
  • infinite scroll without loading image
  • Backbone: reverse collection order with comparator
  • What do printers ignore?
  • jQuery UI .tabs() Contentless tab?
  • Execute Javascript alert() after page (visually) loaded
  • JavaScript - duplicating array doesn't work
  • Excessive clickable area below image
  • JavaScript Regex: Replace |b| with <b>
  • Unexpected value change in 2D array in JavaScript
  • Function doesnt see parameter as a array of objects
  • jQuery fetch keypress event on chrome and IE
  • How to enable jquery validate localization?
  • Cassandra map collection returned by node.js Helenus looks odd
  • angular ng-repeat with multiple filter options
  • Selecting Children without ID or Class names
  • How to uncheck a group of checkboxes when another checkbox is checked
  • Is hiding content by Javascript or jQuery Worth trying
  • Load XUL resource using javascript
  • XML to HTML text area from server file system
  • set focus() on textbox on form onload
  • es lint '' is assigned a value but never used' eventhough i have used it
  • Can "name" attribute be used for custom VueJS components
  • Get innerHTML of content when it is clicked
  • HTTPS causes CSS animations to not load? Very confused
  • How to hide other div apart from touched div to the band
  • Is global variable assignment atomic on NodeJS?
  • Datepicker onchangemonthyear beforeshowday
  • trying to render html files using jade but it still adresses it as a jade
  • Google Analytics - Understanding and Dissecting the Snippet: What is | | [ ];
  • Replacing "[aA09.b]." to "[aA09.b]\n" in in JavaScript
  • Why wrap a function definition in an immediate function?
  • Enable / disable jQuery script on switching to different tab in a HTML page
  • how can find return variable value outside anonymous function in node js mysql query function
  • Converting 1 to 0001 in javascript array
  • svg viewbox should not resize the text fontSize?
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org