我想要設計一個頁面,其中像頁眉,導航欄,按鈕,標題,段落等頁面的內容應放置在幻燈片上。但問題是當我在div容器或body上添加內容時,內容沒有正確顯示在幻燈片上。任何人都可以告訴我該怎麼辦?
下面是代碼:如何把jQuery圖像滑塊內的HTML內容?
<html>
<head>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(document).ready(function(){ //This is jquery code for fade slideshow
$('.pics').cycle('fade');
});
</script>
<style type="text/css">
.pics { //this is style of container (div) which contain images
height: 100%;
width: 100%;
position:absolute;
left:0;
top:0;
margin-right:0;
}
.pics img { //style of images
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<h3>This is heading</h3>//It is not appearing properly
<div class="pics"> //html code for container
<img src="adv1_wheels_ferrari_f430-HD.jpg" width="100%" height="500" />
<img src="kepler_motion-HD.jpg" width="100%" height="100%" />
<img src="nissan_gt_r_gold-HD.jpg" width="100%" height="100%" />
<p>This is paragraph</p>// this is insides div and also not appearing properly
</div>
</body>
</html>
保持滑塊「相對」的位置,然後設置內容的絕對位置。這將是有益的,如果你可以張貼小提琴, – CodeRomeos
我已經嘗試過,但它不起作用 –
如果你可以張貼小提琴 – CodeRomeos