Jump to content
  • 0

Изменения в скрипт


arsentev78
 Share

Question

Скажите пожалуйста, можно ли внести изменения в скрипт, что бы первая картинка слайд шоу появлялось плавно.

<script type="text/javascript"
src="js/jquery.min.js">
</script>
<style>

#bg {
position:fixed;
top:-50%;
left:-50%;
width:200%;
height:200%;
}
#bg img {
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
margin:auto;
min-width:50%;
min-height:50%;
}

#page-wrap { position: relative; z-index: 2; width: 400px; margin: 50px auto; padding: 20px; background: white; -moz-box-shadow: 0 0 20px black; -webkit-box-shadow: 0 0 20px black; box-shadow: 0 0 20px black; }
p { font: 15px/2 Georgia, Serif; margin: 0 0 30px 0; text-indent: 40px; }
</style>

</head>
<body>
<div id="bg">
<img src="images/1.jpg" alt="Hallway" id="slide_show" >
</div>

<script type="text/javascript">
var imgs = ["images/1.jpg","images/2_2.jpg","images/3.jpg","images/4.jpg","images/5.jpg","images/6.jpg"];
var text = ['Картинка 1','<a href="index.php">Картинка 2</a>',
'<font color="red">Картинка 3</font>','Картинка 4'];
var n=0;
time=400;
play=setInterval("chgImg(0)", 5000);
function chgImg(number) {
if (number!=0) n=number-2;
$('#slide_show').fadeOut(time, function() { //для картинок
$(this).attr('src', imgs[n]).fadeIn(time);
});
$('#slide_text').fadeOut(time, function() { //для текста
$(this).html(text[n]).fadeIn(time);
});
n++;
if (n>=imgs.length) n=0;
}
</script>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy