hide the boostrap 4 fixed navbar during ajax call

239
December 23, 2017, at 09:36 AM

Just wondering how one would go about hiding a boostrap 4 fixed-top navbar during a ajax call loading data from the database. Then after the ajax call the navbar would be shown again.

Would this work?

$('{navbarSelector}').hide();
 $.ajax(
     url: "fetchData.php",
     success: function(result){
         $('{navbarSelector}').show();
}});

replacing the {navbarSelector} text with the correct selector. I've tried using the 'navbar' class as the {navbarSelector} but it didn't work.

Thanks in advance for any assistants.

Answer 1

Are you sure, that the navbar provides hide() and show() functionality?

You could try the following:

$('{navbarSelector}').css("display","none");
$.ajax(
   url: "fetchData.php",
   success: function(result){
     $('{navbarSelector}').css("display","block");
}});

It would be nice if you had some more information.

Rent Charter Buses Company
READ ALSO
CSS -IONIC 2. Display the full value from ion-input or ion-option on screen once selected

CSS -IONIC 2. Display the full value from ion-input or ion-option on screen once selected

I am trying to display the full text from the value picked in an ion-input or ion-optionThe problem is that the name of the value is displayed just a half

268
Trying to find a specific example of SVG animation [on hold]

Trying to find a specific example of SVG animation [on hold]

I'm trying to track down the URL of a French vineyard that uses SVG to animate some simple but very effective birds; the site reference is needed for an upcoming projectTrouble is, I'm struggling to find it online, so was wondering if anyone out there can help please?...

204
Dynamically add corner ribbon to an image request (C#)

Dynamically add corner ribbon to an image request (C#)

Has anyone seen a library or NuGet perhaps that adds a corner ribbon to an image requestI am thinking something like the Re-sizer package which changes the image size to that of your parameters (i

190
How Do I Move a Post iframe outside the Post Body in Blogger?

How Do I Move a Post iframe outside the Post Body in Blogger?

I want to be able to take the first iframe used in my blog posts, and move it outside of the post body and into a div I created called #myvideosI've seen blog templates like this one accomplish this, moving a video out of the post body

218