07.24.2010
Categories: english | Add a Comment
/*! * jQuery Sample Plugin * * http://saquery.com * */ (function(){ $.fn.setBorderStyle = function( settings ) { var _defaults = { 'border':'solid 1px black', 'color':'red' }, _config = $.extend(_defaults, settings), _ = $(this); return _.each(function(i,n) { $(this).css(_config); }); }; })(jQuery); $(function(){ $('div').setBorderStyle(); }) Test 1 : Invoke setBorderStyle with default settings. $('div').setBorderStyle(); Invoke "Test 1" [...]
07.22.2010
Categories: english | Add a Comment
This sample shows a good and well structured way to code your own WordPress Plugin in PHP. <?php /* Plugin Name: Your plugin-name Plugin URI: http://www.example.com Description: Your description. Version: 1.0.0.0 Author: Your name Author URI: http://www.example.com */ global $myWordpressPlugin; $myWordpressPlugin = new myWordpressPlugin(); class myWordpressPlugin{ function wp_head(){ echo '<!-- test -->'."\n"; } } add_action('wp_head', [...]
07.16.2010
The big players on the Internet offer a good possibility to include well known JavaScript libraries in your own websites. There is no need for a own webspace. This is an example to load jQuery and jQuery UI with the basic theme from Google CDN. <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" [...]