โดย jamepiyawat » 25/07/2019 12:02 pm
พอว่าผมนั้นได้ทำ modal ที่จะแสดงรูปภาพออกมาคือผมสามารถกำหนดรูปได้ว่าจะแสดงรูปขนาดเท่าไรแต่ว่า modal ก็ยังมีด้านข้างที่ใหญ่เกินไปแล้วบ้างรูปก็ยังแสดงออกมาเกินกรอบ modal อีกด้วย
อยากที่ทราบวิธีการกำหนดขนาด modal bootstrap ให้ modal มีขนาด 800 X 500 ครับ
โค้ดที่ใช้
โค้ด: เลือกทั้งหมด
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<center><p>รูปทุเรียน</p>
<img src="<?php echo JUri::root() . '/image/image_fruit/h24.jpg' ; ?>" width="500" height="300"></center>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
รูปที่แสดง
ตัวอย่างที่อยากทำได้
- Selection_999(131).png (148.98 KiB) Viewed 5454 times
พอว่าผมนั้นได้ทำ modal ที่จะแสดงรูปภาพออกมาคือผมสามารถกำหนดรูปได้ว่าจะแสดงรูปขนาดเท่าไรแต่ว่า modal ก็ยังมีด้านข้างที่ใหญ่เกินไปแล้วบ้างรูปก็ยังแสดงออกมาเกินกรอบ modal อีกด้วย
อยากที่ทราบวิธีการกำหนดขนาด modal bootstrap ให้ modal มีขนาด 800 X 500 ครับ
โค้ดที่ใช้
[code]<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<center><p>รูปทุเรียน</p>
<img src="<?php echo JUri::root() . '/image/image_fruit/h24.jpg' ; ?>" width="500" height="300"></center>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>[/code]
รูปที่แสดง
[attachment=2]Selection_999(130).png[/attachment]
[attachment=1]Selection_999(129).png[/attachment]
ตัวอย่างที่อยากทำได้
[attachment=0]Selection_999(131).png[/attachment]