Table of contents

M4Q Population

Population

The main object named by: m4q. If window.$ is undefined, m4q use its. To add alias $ for m4q manually, you can use method m4q.global(). To relinquish m4q's control of the $, you can use method m4q.noConflict([true]).

Gains control of $

                    <script src="metro.js">

                    $ - is a m4q constructor
                
$ not a free

                    <script src="jquery.js">
                    <script src="metro.js">

                    $ - is a jquery constructor
                
Relinquish m4q's control of the $

                    <script src="metro.js">
                    <script>
                        $.noConflict();
                    </script>

                    $ - now have is a previous value
                
Capture and relinquish of the $

                    <script src="jquery.js">
                    <script src="metro.js">
                    <script>
                        m4q.global(); // $ - now is a m4q constructor
                        m4q.noConflict(); // $ - now is a jquery constructor
                    </script>
                

Populate Metro 4 components to the jQuery.fn

If you have work with Metro 4 components with jQuery, you must define it with special meta tag:


                    <meta name="metro4:jquery" content="true">
                

Now you can initialize components with jquery.


                    <div id="a1">
                        ...
                    </div>

                    <script>
                        $("#a1").accordion();
                    </script>