2012-06-29 7 views
0

나는 슬라이드 쇼를 .....슬라이드 쇼, 슬라이드 효과

 <script type="text/javascript"> 
    <!-- 
    var image1=new Image() 
    image1.src="slide-image-1.png" 
    var image2=new Image() 
    image2.src="slide-image-2.png" 

    //--> 
    </script> 

<img name="slide" class="image1" src="slide-image-1.png" /> 
<script> 
<!-- 
//variable that will increment through the images 
var step=1 
function slideit(){ 
//if browser does not support the image object, exit. 
if (!document.images) 
return 
document.images.slide.src=eval("image"+step+".src") 
if (step<2) 
step++ 
else 
step=1 
//call function "slideit()" every 2.5 seconds 
setTimeout("slideit()",4000) 
} 
slideit() 
//--> 
</script> 

나는 슬라이드를 수평 (난이 말이 희망을 오른쪽에서 왼쪽으로 스크롤하여 서로 교환하는 방식을 변경하려면). 이 전환 유형은 무엇이라고 부탁합니까? 간단한 몇 줄로 끝낼 수 있습니까?

(I이 아마 경험있는 웹 디자이너를위한 쉬운 일이 알고 있지만 이제 막 시작 필자와이 어떻게 될지에 관해서는 확실하지)

+2

최초의 애니메이션에 대한 의사 코드 추가 등의 효과를 얻기 위해 jQuery를 사용할 수 있습니다. 너는 그것을 필요로하지 않으며 나쁜 습관이다. – TheZ

+0

죄송합니다 무슨 eval주세요 제발 ?? – user1491979

+0

+1, 배열로 구조를 바꾸면 eval이 필요하지 않습니다. – gcochard

답변

1

는이 작업을 수행하기 위해 jQuery를 사용할 수 있습니다. 플러그인 번호는 here입니다.

0

당신은 단순히`eval`를 사용하지 않는, 내가이 div의

모든
<body> 
    <div id="divone" style="background-color:#808080;width:150px;height:250px;"></div> 
    <div id="div1" style="background-color:#0026ff;width:150px;height:250px;display:none;"></div> 
    <script> 
     //jQuery("#divone").animate({ opacity: 0.10 }, 5000); 
     //jQuery("#divone").fadeOut(5000); 
     jQuery("#divone").fadeOut(5000, function() { jQuery("#div1").fadeIn(5000) }) 
    </script> 
</body>