vk
" uCoz - это не просто бесплатный хостинг и CMS, но и средство заработка! "

Сайт-помощник по uCoz [ Beta ]

Данный раздел находится в разработке!
Поэтому может не корректно отображатся и функционировать!

Интересный слайдер

Описание: Довольно простой в установке и визуально необычный слайдер. Очень интересный эффект ипри перелистывании картинок, плюс название картинке на картинке.



Установка : ставим код ниже, в то место где хотим видеть слайд шоу. В этом коде скрипт слайдера и его стили css.

Код
<style>  
.textboxstyle {
font-family:Arial;
font-size:16pt;
color:black;
text-align:center;
vertical-align:top;
}

.textboxbackgroundstyle {
background-color:white;
padding:5px;

/* rounded corners for Firefox */
-moz-border-radius-topleft: 15px;
-moz-border-radius-bottomright: 15px;

/* rounded corners for for Safari and Chrome */
-webkit-border-top-left-radius: 15px;
-webkit-border-bottom-right-radius: 15px;

/* rounded corners for Opera */
border-top-left-radius: 15px;
border-bottom-right-radius: 15px;
}

.curveandshadowstyle {

/* shadow and rounded corners for Firefox */
-moz-box-shadow: 5px 5px 8px #818181;
-moz-border-radius-topleft: 25px;
-moz-border-radius-bottomright: 25px;

/* shadow and rounded corners for Safari and Chrome */
-webkit-box-shadow: 5px 5px 8px #818181;
-webkit-border-top-left-radius: 25px;
-webkit-border-bottom-right-radius: 25px;

/* shadow and rounded corners for Opera */
box-shadow: 5px 5px 5px #818181;
border-top-left-radius: 25px;
border-bottom-right-radius: 25px;

/* shadow for Internet Explorer */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Direction=135, Color='#818181');

border-style:solid;
border-width:1px;
border-color:white;
}
</style>

  <div id="links" style="display:none;">

  </div>  

   
<script>

var imgurl= new Array()
var message= new Array()
var thislink= new Array()

// set the url (or path) of your images. Add as many images as you like
imgurl[0]="http://umasters.ucoz.ru/_ld/0/66418993.jpg"
imgurl[1]="http://umasters.ucoz.ru/_ld/0/50265442.jpg"

// set the messages corresponding to the images above (no more no less than the images above)
message[0]="рыбки"
message[1]="сердечки"

// set the links corresponding to the images above (no more no less than the images above)
// If you dont want to add a link enter a #"instead of http://umasters.ucoz.ru, see smaple below
thislink[0]="http://umasters.ucoz.ru"
thislink[1]="http://umasters.ucoz.ru"

// width of pictures (pixel)
var imgwidth=300

// width of pictures (pixel)
var imgheight=180

// set stillstand of picture (seconds)
var stillstand=2.5

// set opacity-strength (transparency-effect). Values may range from 1 to 100
var opacitystrength=60

/////////////////////////////////////////////////
// SCRIPT-CONFIGURATION STOPS HERE
/////////////////////////////////////////////////

// Do not edit below this line
var tmr
var step=10
var i=imgwidth
var i_imgurl=0
stillstand*=1000

var preloadedimages=new Array()
for (iii=0;iii<imgurl.length;iii++){
  preloadedimages[iii]=new Image()
  preloadedimages[iii].src=imgurl[iii]
}

function shrinkpic() {
  document.getElementById("textbox").innerHTML=""
  if (i>0) {
  i-=step
  document.getElementById("picdiv").style.width=i+"px"
  document.getElementById("picdiv").style.height=i*(imgheight/imgwidth)+"px"
  document.getElementById("picdiv").style.left=imgwidth/2-(i/2)+"px"
  document.getElementById("picdiv").style.top=(imgwidth/2-(i/2))*(imgheight/imgwidth)+"px"
  tmr=setTimeout("shrinkpic()",20)
  }
  else {
  i_imgurl++
  if (i_imgurl>=imgurl.length) {
  i_imgurl=0
  }
  document.getElementById("picdiv").style.background="url("+imgurl[i_imgurl]+")"
  i=1
  tmr=setTimeout("enlargepic()",20)
  }
}

function enlargepic() {
  if (i<=imgwidth) {
  i+=step
  document.getElementById("picdiv").style.width=i+"px"
  document.getElementById("picdiv").style.height=i*(imgheight/imgwidth)+"px"
  document.getElementById("picdiv").style.left=imgwidth/2-(i/2)+"px"
  document.getElementById("picdiv").style.top=(imgwidth/2-(i/2))*(imgheight/imgwidth)+"px"
  tmr=setTimeout("enlargepic()",20)
  }
  else {
  i=imgwidth
  showmessage()
  }
}

function showmessage() {
  document.getElementById("textbox").innerHTML='<span class="textboxbackgroundstyle">'+message[i_imgurl]+'</span>'
  tmr=setTimeout("shrinkpic()",stillstand)
}

function gotothislink(){
  document.location.href=thislink[i_imgurl]

}

document.write('<div id="roof" style="position:relative;width:'+imgwidth+'px;height:'+imgheight+'px;">')
document.write('<div id="picdiv" class="curveandshadowstyle" style="position:absolute;background:url('+imgurl[0]+');width:'+imgwidth+'px;height:'+imgheight+'px;top:0px;left:0px;"></div>')

document.write('<div id="tt" onClick="gotothislink()" style="position:absolute;width:'+imgwidth+'px;height:'+imgheight+'px;top:0px;left:0px;filter:alpha(opacity='+opacitystrength+');opacity:'+(opacitystrength/100)+';cursor:pointer;"><table width='+imgwidth+' height='+imgheight+'><tr><td id="textbox" class="textboxstyle"><span class="textboxbackgroundstyle">'+message[0]+'</span></td></tr></table></div>')

document.write('</div>')

window.onload=shrinkpic
</script>


Настройка: Свои картинки ставить тут:

imgurl[0]="http://umasters.ucoz.ru/_ld/0/66418993.jpg"
imgurl[1]="http://umasters.ucoz.ru/_ld/0/50265442.jpg"

их название тут:

message[0]="рыбки"
message[1]="сердечки"

а ссылки тут:

thislink[0]="http://umasters.ucoz.ru"
thislink[1]="http://umasters.ucoz.ru"
Автор публикации: WooFi   Повысить репутацию WooFi за эот материал
Источник: Смотреть | Дата публикации: 16.01.2013 | Просомтров: 1917
$ Помощь по установке и настройке $

Платная помощь по uCoz

Комментарии ↓

avatar
0
1 Prochtenniy 20:58, 14.09.2014
Здравствуйте. Блок INTRO это у вас картинка и ниже приветствие. Можете ставить и туда этот слайдер. Стаить нужно полностью код который дан выше в материале.  Ставить нужно либо после картинки или до. После текста или до начала текста.  Савьте и пробуйте, где будет лучше.
avatar
2 Аdmin 20:15, 15.09.2014
Спасибо :) Буду пробовать. Посмотрю, что из этого получится.

rm">
avatar