Script of the phone numbers dynamic insertion. JavaScript (jQuery) version installation.

Script is implemented as jQuery plugin. Therefore, will be necessary: jQuery library and jquery.cookie.js plugin.

Code installation is very simple, just connect our library and call function.

  1. <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
  2. <script src="//ringostat.com/numbers/jquery.cookie.js"></script>
  3. <script src="//ringostat.com/numbers/ringostat.min.js"></script>
  4. <script>
  5. $(document).ready(function(){
  6. $('.testing_div').ringostat({
  7. mask: '(###) ### - ## - ##', // optional, phone number show mask
  8. id: 'UA-461323854-88' // required, Google Analytics identifier
  9. });
  10. });
  11. </script>

Full page code example with installed script of the phone numbers dynamic insertion:51pfLF8PeLXrh8F8JSXO 

As you can see, in block with class .testing_div will be placed the phone number.

Function call $.ringostat(); first parameter — settings object. Available options:

  • mask - phone number show mask. Where is # — numeric. Optional, used for installation of number form (for example, to allocate city code by red color, mask will be: "<span style="color: red;">(###)</span> ### - ## - ##")
  • id - Google Analytics identifier, required

Second parameter — optional, callback function. Function, will be called after the plugin job done.

Была ли статья полезной?