http://jsfiddle.net/4QZED/6/。選択されていない無線とホバー/マウスオーバーの3つの状態を作成しようとしています。この状態のそれぞれがcss/div/buttonです。しかし、ボタンにラベルのテキストを保持するために、ラベルをボタンにしようとしています。
ページがズームされたときに画像が劣化しないように、jpgではなくcssを使用してください。
$(function() {
$("input[name='domain_ext']").each(function() {
if ($(this).prop('checked')) {
$(this).hide();
$(this).after("<div class='radioButtonOff'> label </div>");
} else {
$(this).hide();
$(this).after("<div class='radioButtonOff'> label </div>");
}
});
$("input[type=radio]").change(function() {
$(this).siblings('.radioButtonOff').add('.radioButtonOn').toggleClass('radioButtonOff radioButtonOn');
});
/*
$(".radioButtonOff").mouseover(function() {
if ($(this)toggle('.radioButtonHover');
});
$("input[type=label]").change(function() {
if($(this).find('#radiolabel');
$(this).hide();
$(this).after("input[type=label]").add(span);
});
*/
});