TOP /すぐに使えるJavaScript | 初めだけ表示するポップアップ |
---|
open
<style type=text/css><!-- /* 表示部分スタイル */ #show{ position:absolute;top:5px;left:5px; border: 1px solid gray; width:200px; height:150px; background-color: #ccccff; padding-right:3px; padding-left:3px; } .point{ font-size: 10pt; border: 1px solid gray; cursor:pointer;cursor:hand; } --></style> <script type="text/javascript"><!-- theName="onload_text="; //cookie名 theday=1; //cookie保存日数 //---------------------------------------------- function onload_text_set(){ theCookie=document.cookie+";"; start=theCookie.indexOf(theName); if(start !=-1){ end=theCookie.indexOf(";",start); theData=theCookie.substring(start+theName.length,end); document.showform.showcheck.checked=(theData=="t")?true:false; if(theData=="t") document.getElementById('show').style.display='none'; } } function onload_text_close(){ myData="";setDay=new Date(); myData=(document.showform.showcheck.checked==true)?"t":"f"; setDay.setTime(setDay.getTime()+(theday*1000*60*60*24)); document.cookie=theName+myData+";expires="+setDay.toGMTString(); }/*himajin.moo.jp*/ onload=onload_text_set; onunload=onload_text_close // --></script> <!--表示部分ここから--> <form name="showform"> <div id="show"> <span class="point"onclick="document.getElementById('show').style.display='none';">close</span> <input id="chck"name="showcheck"type="checkbox"checked><label for="chck"style="font-size:10pt;">次回から表示しない</label> <hr width=100%> 初めての方への説明等を<br> ここに書く </div> </form> <!--表示部分ここまで--> <span class="point"onclick="document.getElementById('show').style.display='block';">open</span>