จะให้ dialog มันแสดงแบบ alert ได้ยังไงครับ

เริ่มโดย internalworldsite, 29 มกราคม 2014, 08:48:16

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

internalworldsite

ตอนนี้กำลังทำฟอร์ม สมัครสมาชิก แบบเก่าที่ผมใช้คือ javascript alert แต่ไปเห็น dialog ที่แจกในเว็บไซด์มันสวยกว่า ผมจะดึง dialog ให้มันแสดงแบบ alert ได้ยังไงครับ

alert มันจะแสดงทันทีเมื่อ refresh หรือเข้าหน้าเพจ

แต่ dialog มันเป็น <div class="xx">xx</div>

รบกวนผู้รู้ขอแนวทางด้วยครับ
อย่าหยุดพัฒนา

Jaynarol

dialog ที่แจกในเว็บไซด์มันสวยกว่า << เว็บไหนครับ ต้องดูก่อนว่าต้องการแบบไหนเพราะมันมีเยอะมากครับ

ส่วนใหญ่จะเป็น jQuery ครับ ต้องโหลดไฟล์ jQuery เข้าไปด้วยครับ

internalworldsite

#2
อันนี้อ่าครับ jquery
http://www.freshdesignweb.com/demo/index.php?p=1379319976



<div id="modal">
   <div id="heading">
      Are you sure you want to do that?
   </div>

   <div id="content">
      <p>Clicking yes will make Comic Sans your new system<br> default font. Seriously, have you thought this through?</p>

      <a href="#" class="button green close"><img src="images/tick.png">Yes, do it now!</a>

      <a href="#" class="button red close"><img src="images/cross.png">No, I'm insane!</a>
   </div>
</div>
อย่าหยุดพัฒนา

internalworldsite

อย่าหยุดพัฒนา

ยิ้มโค้ด.คอม

<script type="text/javascript">
$(document).ready(function() {
    $('#modal').reveal({ // The item which will be opened with reveal
  animation: 'fade',                   // fade, fadeAndPop, none
animationspeed: 600,                       // how fast animtions are
closeonbackgroundclick: true,              // if you click background will modal close?
dismissmodalclass: 'close'    // the class of a button or element that will close an open modal
});

});
</script>


ถ้าจะให้มันแสดงทันทีหลังโหลดหน้าเพจเสร็จลองปรับในส่วน javascript ให้เหลือตามข้างบนดูครับว่าได้ไหม

ปล.ผมไม่ได้เทสน่ะครับ ผิดพลาดยังไงก็ขออภัยด้วย

internalworldsite

อย่าหยุดพัฒนา