jQuery.fn.opening = function (mymsg) { return this.each(function () { if($.cookie("opening") != "checked") { $(this).append($("
" + mymsg + "
"); $("#opening").append("今後はこのメッセージを表示しない。
"); $("#opening").append(""); $("#opening").css("position", "absolute"); $("#opening").css("background-color", "lightgrey"); $("#opening").css("border", "solid 2px"); $("#opening").css("border-color", "whitesmoke black black whitesmoke"); $("#opening").css("padding", "20px"); $("#opening").css("left", ($(window).width() - $("#opening").width()) / 2); $("#opening_close").click(function () { if($("#opening_check").attr("checked") == "checked") { $.cookie("opening", "checked", {expires:30}); } $("#opening").hide(); }); } }); } $("#delcookie").click(function () { $.cookie('opening', null); });