// JavaScript Document (function($){ $.fn.newsList=function(op){ //デフォルトオプション var defOp={ overColor: '#eeeeee', //デフォルトのロールオーバーカラー outColor: '#ffffff' //デフォルトのロールアウトカラー }; $.extend(defOp,op||{}); return this.each(function(){ //初期化処理 $(this).find('dd:has(a)').each(function(){ var t_url=$(this).find('a').attr('href'); $(this).prev().hover( function(){ $(this).css({backgroundColor:defOp.overColor,cursor:'pointer'}); $(this).next().css({backgroundColor:defOp.overColor}); }, function(){ $(this).css({backgroundColor:defOp.outColor,cursor:'default'}) $(this).next().css({backgroundColor:defOp.outColor}); } ).click(function(){location.href=t_url;}); $(this).hover( function(){ $(this).css({backgroundColor:defOp.overColor,cursor:'pointer'}); $(this).prev().css({backgroundColor:defOp.overColor}); }, function(){ $(this).css({backgroundColor:defOp.outColor,cursor:'default'}) $(this).prev().css({backgroundColor:defOp.outColor}); } ).click(function(){location.href=t_url;}); }); }); }; })(jQuery)