Installation Do icheck

Asked

Viewed 475 times

6

I can’t seem to do the icheck work

i install I do the inclusion of css and js files in my index and even then it does not work checkboxes and radiobuttons remain the same thing, someone can help me please..

in my head it’s like this

<link rel="stylesheet" href="plugins/iCheck/all.css">

and my checkbox is like this

 <div class="box box-success">
            <div class="box-header">
              <h3 class="box-title">iCheck - Checkbox &amp; Radio Inputs</h3>
            </div>
            <div class="box-body">
              <!-- Minimal style -->

              <!-- checkbox -->
              <div class="form-group">
                <label>
                  <input type="checkbox" class="minimal" checked>
                </label>
                <label>
                  <input type="checkbox" class="minimal">
                </label>
                <label>
                  <input type="checkbox" class="minimal" disabled>
                  Minimal skin checkbox
                </label>
              </div>

              <!-- radio -->
              <div class="form-group">
                <label>
                  <input type="radio" name="r1" class="minimal" checked>
                </label>
                <label>
                  <input type="radio" name="r1" class="minimal">
                </label>
                <label>
                  <input type="radio" name="r1" class="minimal" disabled>
                  Minimal skin radio
                </label>
              </div>

              <!-- Minimal red style -->

              <!-- checkbox -->
              <div class="form-group">
                <label>
                  <input type="checkbox" class="minimal-red" checked>
                </label>
                <label>
                  <input type="checkbox" class="minimal-red">
                </label>
                <label>
                  <input type="checkbox" class="minimal-red" disabled>
                  Minimal red skin checkbox
                </label>
              </div>

              <!-- radio -->
              <div class="form-group">
                <label>
                  <input type="radio" name="r2" class="minimal-red" checked>
                </label>
                <label>
                  <input type="radio" name="r2" class="minimal-red">
                </label>
                <label>
                  <input type="radio" name="r2" class="minimal-red" disabled>
                  Minimal red skin radio
                </label>
              </div>

              <!-- Minimal red style -->

              <!-- checkbox -->
              <div class="form-group">
                <label>
                  <input type="checkbox" class="flat-red" checked>
                </label>
                <label>
                  <input type="checkbox" class="flat-red">
                </label>
                <label>
                  <input type="checkbox" class="flat-red" disabled>
                  Flat green skin checkbox
                </label>
              </div>

              <!-- radio -->
              <div class="form-group">
                <label>
                  <input type="radio" name="r3" class="flat-red" checked>
                </label>
                <label>
                  <input type="radio" name="r3" class="flat-red">
                </label>
                <label>
                  <input type="radio" name="r3" class="flat-red" disabled>
                  Flat green skin radio
                </label>
              </div>
            </div><!-- /.box-body -->
            <div class="box-footer">
              Many more skins available. <a href="http://fronteed.com/iCheck/">Documentation</a>
            </div>
          </div><!-- /.box -->
  • you are importing the Javascript file at the end of the <body> ?

  • I put yes, but even so it simply does not modify the checkbox

  • And jQuery ? You are importing ?

  • I am also importing

  • Funny thing is there’s a demo page that I downloaded and it works normally, I copied her code and it didn’t work

  • has some problem with your import, look at the browser console that you are using, it’s all ok ?

  • Any error in console?

  • @Hiagosouza guy has some bugs on the console

  • Uncaught Referenceerror: $ is not defined(Anonymous Function) @index.php? mod=info-product:365 Morris.min.js:6 Uncaught Error: Graph container element not found

  • so colleague this is jquery

Show 6 more comments

2 answers

0

You are initiating the icheck on input ? try this:

<input type="checkbox" class="icheckbox_square-green">

$(document).ready(function(){
  $('.icheckbox_square-green').iCheck({
    checkboxClass: 'icheckbox_square-green'
  });
});

0

As informed the error presented is:

Uncaught ReferenceError: $ is not defined(anonymous function) @ index.php?mod=info-produto:365 morris.min.js:6 Uncaught Error: Graph container element not found

This is due to the lack of jQuery on the page, below is the example of library inclusion:

Put the code below under your tag <title>...</title>

<title>...</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
  • I tried the way you said and it didn’t work

Browser other questions tagged

You are not signed in. Login or sign up in order to post.