/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script type='text/javascript'> $(document).ready(function(){ $.getScript('http://jquery-translate.googlecode.com/files/jquery.translate-1.3.2.min.js', function(){ //when the script is loaded $.translate(function(){ //when the Google Language API is loaded $.translate().ui('select', 'option') //generate dropdown .change(function(){ $('#translateit').translate( 'en', { //revert to english first not: 'select, pre' }) .translate( 'en', $(this).val(), { not: 'select, pre', async: true, toggle: true, walk: false }); }) .val('English') //select English as default .appendTo('#nav'); //insert the dropdown to the page }); }); }); </script>
URL: http://webupd8.blogspot.com