Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font Awesome 5 not spinning icon?

Tags:

font-awesome

I have an MVC project with Bootsrap 4 (SASS) and Font Awesome 5. I'm trying to get an spinning icon to work for use with an Ajax loading panel but it's not working.

<a href="#" class="btn btn-danger">
    <i class="fas fa-spinner fa-pulse"></i> Test Spin
</a>

<a href="#" class="btn btn-danger">
    <i class="fas fa-home fa-fw"></i> Test icon
</a>

I have the following buttons for testing. The one with just the icon in the button displays the FA icon but the button with the FAS spinning icon doesn't display.

For FontAwesome all I have is the "~/Scripts/fontawesome-all.min.js" file referenced. From my understanding that's all I needed to do?

This is my bundle:

bundles.Add(new ScriptBundle("~/bundles/vendorscripts").Include(
                      "~/Scripts/bootstrap.min.js",
                      "~/Scripts/respond.min.js",
                      "~/Scripts/fontawesome-all.min.js"));

This is my layout page:

@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/vendorscripts")
@RenderSection("scripts", required: false)

enter image description here

like image 462
Caverman Avatar asked Mar 21 '18 21:03

Caverman


People also ask

Why My Font Awesome icons are not working?

Make sure you're using the latest and greatest by updating your CDN code reference, updating your Font Awesome package via npm, or downloading a fresh copy of Font Awesome. You can check with version an icon was added to on its detail page (e.g. question-circle was added in Verion 1 but last updated in 5.0.

How do I use Font Awesome 5 icons?

To use the Free Font Awesome 5 icons, you can choose to download the Font Awesome library, or you can sign up for an account at Font Awesome, and get a code (called KIT CODE) to use when you add Font Awesome to your web page.

Is Font Awesome no longer free?

Font Awesome Free is free, open source, and GPL friendly. You can use it for commercial projects, open source projects, or really almost whatever you want.

Are Font Awesome icons royalty free?

Font Awesome is fully open source and is GPL friendly. You can use it for commercial projects, open source projects, or really just about whatever you want.


1 Answers

You need to use fa-spin class also to make it spin.

<a href="#" class="btn btn-danger">
    <i class="fas fa-spinner fa-spin"></i> Test Spin
</a>
like image 93
Nehal Hasnayeen Avatar answered Oct 20 '22 10:10

Nehal Hasnayeen