여기 볼 수있는 간단한 MVC 4 사이트를 만들 언급했다. JQuery이CSS DIV 위치 오버레이 이미지는
<script type="text/javascript">
jQuery(document).ready(function() {
$('.fadein img:gt(0)').hide();
setInterval(function() {
$('.fadein :first-child').fadeOut()
.next('img').fadeIn()
.end().appendTo('.fadein');
},
3000);
});
</script>
은 다음 내 index.cshtml에서 마크 업이 될 때 :
것은 내가 저자 여기에서 초기 JS를 사용하고 이미지를 대체하려면
<div id="intro">
<p>
Don't let memories fade - preserve them for generations to come.<br />
Yorkshire Image Scanning can create perfect digital copies of your photographs, stored on DVD or USB memory stick.
The access the digital images simply insert into a DVD player and a slideshow will start to run.
Alternatively, the images can be copied to your PC, iPad, smartphone etc and backed up using any normal method such as external hard disk or DVD copies or cloud storage.
Of course, digital images are so much easier to share than old photographs. Upload them to facebook and let distant friends share your memories!
</p>
</div>
<div class="fadein">
<img src="~/Content/img/old_photos/1.jpg" alt="Old Photos" />
<img src="~/Content/img/old_photos/2.jpg" alt="Old Photos" />
<img src="~/Content/img/old_photos/3.jpg" alt="Old Photos" />
<img src="~/Content/img/old_photos/4.jpg" alt="Old Photos" />
<img src="~/Content/img/old_photos/5.jpg" alt="Old Photos" />
</div>
다음과 같이 CSS는 다음과 같습니다
#intro {
float: left;
width: 50%;
}
.fadein { width:300px; height:300px; }
.fadein img { position:absolute; left:0; top:0; }
누구든지 내가해야 할 일을 조언 해 주실 수 있습니까? 나이? .fadin img가없는 한 그것이 보인다 : 절대적으로 다음 jQuery가 다음 이미지로 넘어갈 때마다 동시에 각 이미지를 보게된다. 모든 이미지를 이전 div에 상대적인 위치로 설정하여 각 이미지가 이전 이미지를 오버레이하는 방법을 모르겠습니다.
와 함께 작동합니다. – DickieBoy