Monday 15 February 2010

jquery - Using Bootstrap Switch with WordPress -


I do not understand how this could work with my WordPress installation.

When I run from example Gitob and run it on my local machine, the controls work perfectly. But they do not work at all in WordPress. To test it, I have a rewrite rule so that www.url.com/testing points to sandbox.php I have placed the following files in the same directory as Sandbox.php (which is in my child's theme folder):

  1. bootstrapSwitch.css
  2. jquery.min .js
  3. bootstrapSwitch.js

    This is the content of sandbox.php:

      & lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body style = "padding-top: 50px;" & Gt; & Lt; Link rel = "stylesheet" href = "bootstrapSwitch.css" & gt; & Lt; Script src = "jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "bootstrapSwitch.js" & gt; & Lt; / Script & gt; & Lt; Div class = "switch" data-on = "primary" data-closed = "info" & gt; & Lt; Input type = "checkbox" check / & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

    And all those displayed are a checkbox when I open a .php file that sits in a folder on my desktop that contains all the files, then it is completely Works.

    What's going on here?

    Do you need to load main bootstrap js?

      & lt; Script src = "http: // cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>    

No comments:

Post a Comment