関数分けただけで動かねーのかよ!! と切れておりましたが、分け方間違ってたっぽいです。
例によって阿豆らいち (id:AzuLitchi)さんに教えてもらったら動きました。
jQuery(function ($) { var over18 = Cookies.get("over18"); if(over18 !== "Yes"){ displayContents(); } $('.remove_cookie').click(function(){ Cookies.remove('over18','',{ expires: 0 }); location.reload(); }); function displayContents() { $('#basic-modal-content').modal({ autoResize :true, autoPosition: true, onShow: function(dialog){ var modal = this; $('.yes',dialog.data[0]).click(function(){ var clifetime = new Date(); clifetime.setTime(clifetime.getTime()+(2*60*60*1000));//2時間 Cookies.set('over18','Yes',{expires: clifetime }); modal.close(); }); } }); } });
かっこ{}の位置にちゅうもーく!(多いよ!!)
jQuery(function($){});の中に全部突っ込め、ってことだね。
きっと基本のキなんでしょうね・・・お恥ずかしい限りです。