
手順:
1、koma2モジュール作成
2、js/my1.js作成
3、my1.js内容
(function ($)
{
Drupal.behaviors.koma2UserFocus =
{
attach : function()
{
$('input#edit-name').focus();
}
};
}(jQuery));
4、koma2.modulefunction koma2_init()
{
global $user;
$path = drupal_get_path("module", "koma2");
if ($user->uid == 0)
drupal_add_js($path . "/js/my1.js");
}
Done!
0 件のコメント:
コメントを投稿