Форум программистов, компьютерный форум, киберфорум
HTML, CSS
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.97/34: Рейтинг темы: голосов - 34, средняя оценка - 4.97
0 / 0 / 0
Регистрация: 04.03.2018
Сообщений: 2

Вставка слайд шоу на сайт

04.03.2018, 18:55. Показов 6639. Ответов 2
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Здравствуйте, в веб разработке не разбираюсь вовсе, но потребовалось сделать сайт...
Всё кое-как закончил и осталось только запихнуть слайд шоу, здесь и возникла проблема.
Вот сам слайд https://codepen.io/Zaku/pen/YqLOOp, при установке его на сайт не хочет вставать к блок, а тянется практически на весь экран, что то пробовал и в стилях делать (по мере возможности), ничего не выходит((

Помогите пожалуйста, кто знает...
0
Лучшие ответы (1)
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
04.03.2018, 18:55
Ответы с готовыми решениями:

Слайд шоу из 5 картинок
Слайд-шоу 5 картинок , нужен готовый код пожалуйста

Как центрировать слайд-шоу?
Несколько часов провозился, никак не получается настроить вывод слайд-шоу по центру. 1. Модуль Field Slideshow. 2. Пример можно...

Слайд шоу из рекламных баннеров
Добрый день! У меня есть несколько рекламных картинок http://kanevskay-avto.ucoz.com/, я пытаюсь собрать их в виде "слайт шоу"....

2
Эксперт JSЭксперт HTML/CSS
2151 / 1496 / 651
Регистрация: 16.04.2016
Сообщений: 3,696
04.03.2018, 19:10
Лучший ответ Сообщение было отмечено lazylo как решение

Решение

lazylo, вот вам ваш слайдер вставленный в блок с классом .wrap
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<div class="wrap">
  <div class="slides">
    <div class="slide 1th"></div>
    <div class="slide 2th"></div>
    <div class="slide 3th"></div>
    <div class="slide 4th"></div>
    <div class="slide 5th"></div>
  </div>
  <div class="nav">
    <div class="btn-group">
      <div class="btn active"></div>
      <div class="btn"></div>
      <div class="btn"></div>
      <div class="btn"></div>
      <div class="btn"></div>
    </div>
  </div>
</div>
CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.wrap {
  // стили ниже не менять
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
  // эти можно
  height: 200px;
  width: 200px;
  border: 1px solid;
}
.nav {
  text-align: center;
  position: absolute;
  width: 100%;
  bottom: 5%;
  transform: translateY(-50%);
}
.btn-group {
  position: relative;
  display: inline-block;
}
.btn-group .btn {
  cursor: pointer;
  float: left;
  height: 10px;
  width: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  margin-left: 6px;
  margin-top: 1px;
}
.btn-group .btn:first-child {
  margin-left: 3px;
}
.btn-group svg {
  z-index: -1;
  top: 0;
  left: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.btn-group path {
  fill: none;
  stroke: #eee;
  stroke-dasharray: 39, 99999;
  transition: all 1s ease-in-out;
  stroke-width: 2;
}
.slides {
  transition: left 1s ease-in-out;
  height: 100vh;
  position: absolute;
}
.slides .slide {
  height: 100vh;
  width: 100vw;
  float: left;
}
.slides .slide:nth-child(1) {
  background: #c66;
}
.slides .slide:nth-child(2) {
  background: #acac39;
}
.slides .slide:nth-child(3) {
  background: #39ac39;
}
.slides .slide:nth-child(4) {
  background: #40bfbf;
}
.slides .slide:nth-child(5) {
  background: #8c8cd9;
}
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) {if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;}if (window.CP.shouldStopExecution(1)){break;} var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); }
window.CP.exitedLoop(1);
 
window.CP.exitedLoop(1);
 
window.CP.exitedLoop(1);
 
window.CP.exitedLoop(1);
 
window.CP.exitedLoop(1);
 
window.CP.exitedLoop(1);
 
window.CP.exitedLoop(1);
 
window.CP.exitedLoop(1);
 } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
 
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
// https://dribbble.com/shots/2658222
 
var pathLength = 39;
 
var BtnGroup = function () {
  function BtnGroup(group) {
    var _this = this;
 
    _classCallCheck(this, BtnGroup);
 
    this.buttonSpacing = 20;
    this.group = group;
    this.buttons = Array.prototype.slice.call(this.group.querySelectorAll('.btn'));
    this.slides = Array.prototype.slice.call(document.querySelectorAll('.slide'));
    this.slideContainer = document.querySelector('.slides');
    this.slideContainer.style.width = this.slides.length + '00vw';
    this.svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
    this.svg.setAttribute('viewbox', '0 0 ' + this.buttonSpacing * this.buttons.length + ' 16');
    this.path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
    this.path.classList.add('line');
    this.currentPath = 'M ' + -this.buttonSpacing / 2 + ', 14';
    this.currentIndex = -1;
    this.activateIndex(this.buttons.indexOf(this.group.querySelector('.active')));
    this.group.appendChild(this.svg);
    this.svg.appendChild(this.path);
    this.refreshPath();
    this.initButtons();
 
    var _iteratorNormalCompletion = true;
    var _didIteratorError = false;
    var _iteratorError = undefined;
 
    try {
      for (var _iterator = this.buttons[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}if (window.CP.shouldStopExecution(2)){break;}
        var button = _step.value;
 
        button.addEventListener('click', function (e) {
          return _this.onClick(e);
        });
      }
window.CP.exitedLoop(2);
 
window.CP.exitedLoop(2);
 
window.CP.exitedLoop(2);
 
window.CP.exitedLoop(2);
 
window.CP.exitedLoop(2);
 
window.CP.exitedLoop(2);
 
window.CP.exitedLoop(2);
 
window.CP.exitedLoop(2);
 
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion && _iterator.return) {
          _iterator.return();
        }
      } finally {
        if (_didIteratorError) {
          throw _iteratorError;
        }
      }
    }
  }
 
  _createClass(BtnGroup, [{
    key: 'initButtons',
    value: function initButtons() {
      for (var i = 0; i < this.buttons.length; i++) {if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}if (window.CP.shouldStopExecution(3)){break;}
        var center = this.center(i);
        var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
        var pathStr = '';
        pathStr += 'M' + center + ', 14 ';
        pathStr += 'C' + (center + 3) + ', 14 ';
        pathStr += center + 6 + ', 11 ';
        pathStr += center + 6 + ',  8 ';
        pathStr += 'C' + (center + 6) + ',  5 ';
        pathStr += center + 3 + ',  2 ';
        pathStr += center + ',  2 ';
        pathStr += 'C' + (center - 3) + ',  2 ';
        pathStr += center - 6 + ',  5 ';
        pathStr += center - 6 + ',  8 ';
        pathStr += 'C' + (center - 6) + ', 11 ';
        pathStr += center - 3 + ', 14 ';
        pathStr += center + ', 14 ';
        path.setAttributeNS(null, 'd', pathStr);
        path.classList.add('circle');
      }
window.CP.exitedLoop(3);
 
window.CP.exitedLoop(3);
 
window.CP.exitedLoop(3);
 
window.CP.exitedLoop(3);
 
window.CP.exitedLoop(3);
 
window.CP.exitedLoop(3);
 
window.CP.exitedLoop(3);
 
window.CP.exitedLoop(3);
 
    }
  }, {
    key: 'onClick',
    value: function onClick(e) {
      var index = this.buttons.indexOf(e.srcElement || e.target);
      this.activateIndex(index);
    }
  }, {
    key: 'refreshPath',
    value: function refreshPath() {
      this.path.setAttributeNS(null, 'd', this.currentPath);
      this.path.style.strokeDashoffset = (-this.path.getTotalLength() + pathLength) * 0.9965;
    }
  }, {
    key: 'center',
    value: function center(index) {
      return index * this.buttonSpacing + this.buttonSpacing / 2;
    }
  }, {
    key: 'removeClass',
    value: function removeClass(str) {
      if (this.buttons[this.currentIndex]) {
        this.buttons[this.currentIndex].classList.remove(str);
      }
    }
  }, {
    key: 'addClass',
    value: function addClass(str) {
      if (this.buttons[this.currentIndex]) {
        this.buttons[this.currentIndex].classList.add(str);
      }
    }
  }, {
    key: 'activateIndex',
    value: function activateIndex(index) {
      this.slideContainer.style.left = -index + '00vw';
      var lastCenter = this.center(this.currentIndex);
      var nextCenter = this.center(index);
      var offset = 0;
      var sign = index < this.currentIndex ? -1 : 1;
      this.currentPath += 'C' + (lastCenter + sign * 3) + ', 14 ';
      this.currentPath += lastCenter + sign * 6 + ', 11 ';
      this.currentPath += lastCenter + sign * 6 + ',  8 ';
      this.currentPath += 'C' + (lastCenter + sign * 6) + ',  5 ';
      this.currentPath += lastCenter + sign * 3 + ',  2 ';
      this.currentPath += lastCenter + ',  2 ';
      this.currentPath += 'C' + (lastCenter - sign * 3) + ',  2 ';
      this.currentPath += lastCenter - sign * 6 + ',  5 ';
      this.currentPath += lastCenter - sign * 6 + ',  8 ';
      this.currentPath += 'C' + (lastCenter - sign * 6) + ', 11 ';
      this.currentPath += lastCenter - sign * 3 + ', 14 ';
      this.currentPath += lastCenter + ', 14 ';
      this.currentPath += 'L' + nextCenter + ', 14 ';
      this.currentPath += 'C' + (nextCenter + sign * 3) + ', 14 ';
      this.currentPath += nextCenter + sign * 6 + ', 11 ';
      this.currentPath += nextCenter + sign * 6 + ',  8 ';
      this.currentPath += 'C' + (nextCenter + sign * 6) + ',  5 ';
      this.currentPath += nextCenter + sign * 3 + ',  2 ';
      this.currentPath += nextCenter + ',  2 ';
      this.currentPath += 'C' + (nextCenter - sign * 3) + ',  2 ';
      this.currentPath += nextCenter - sign * 6 + ',  5 ';
      this.currentPath += nextCenter - sign * 6 + ',  8 ';
      this.currentPath += 'C' + (nextCenter - sign * 6) + ', 11 ';
      this.currentPath += nextCenter - sign * 3 + ', 14 ';
      this.currentPath += nextCenter + ', 14 ';
      this.removeClass('active');
      this.currentIndex = index;
      this.addClass('active');
      this.refreshPath();
    }
  }]);
 
  return BtnGroup;
}();
 
var groups = Array.prototype.slice.call(document.querySelectorAll('.btn-group'));
 
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
 
try {
  for (var _iterator2 = groups[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}if (window.CP.shouldStopExecution(4)){break;}
    var group = _step2.value;
 
    console.log(new BtnGroup(group));
  }
window.CP.exitedLoop(4);
 
window.CP.exitedLoop(4);
 
window.CP.exitedLoop(4);
 
window.CP.exitedLoop(4);
 
window.CP.exitedLoop(4);
 
window.CP.exitedLoop(4);
 
window.CP.exitedLoop(4);
 
window.CP.exitedLoop(4);
 
} catch (err) {
  _didIteratorError2 = true;
  _iteratorError2 = err;
} finally {
  try {
    if (!_iteratorNormalCompletion2 && _iterator2.return) {
      _iterator2.return();
    }
  } finally {
    if (_didIteratorError2) {
      throw _iteratorError2;
    }
  }
}
1
0 / 0 / 0
Регистрация: 04.03.2018
Сообщений: 2
04.03.2018, 19:14  [ТС]
Фух. Спасибо Вам большое...
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
04.03.2018, 19:14
Помогаю со студенческими работами здесь

Какой скрипт для слайд-шоу
Подскажите кто знает скрипт для слайд шоу, в автоматическом режиме изменение картинки к примеру сюда http://avtologika.denfa.ru/

Ссылки в картинки баннера Слайд-шоу
Доброго времени суток. На сайте есть блок рекламных банеров с 9-ю картинками. Что нужно дописать чтобы каждая картинка работала как...

Кнопки управлением слайд-шоу разместить слева относительно фотографий
Здравствуйте! На сайте есть слайд-шоу http://work.snamy.com.ua/residences.html (открывается при нажатии на фотографии внизу сайта). Сейчас...

Как сделать открытие слайд-шоу в модальном окне при клике на ссылке?
На данный момент по ссылке открывается отдельная страница с несколькими картинками. Хочу сделать просмотр этих картинок на этой же...

Слайд шоу, переместить кнопки радио на центр в слайд шоу
Здравствуйте как переместить кнопки радио с левой стороны на цент или в право? смотрите скнин шот. Спасибо &lt;div...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
3
Ответ Создать тему
Новые блоги и статьи
Использование SDL3-callbacks вместо функции main() на Android, Desktop и WebAssembly
8Observer8 24.01.2026
Если вы откроете примеры для начинающих на официальном репозитории SDL3 в папке: examples, то вы увидите, что все примеры используют следующие четыре обязательные функции, а привычная функция main(). . .
моя боль
iceja 24.01.2026
Выложила интерполяцию кубическими сплайнами www. iceja. net REST сервисы временно не работают, только через Web. Написала за 56 рабочих часов этот сайт с нуля. При помощи perplexity. ai PRO , при. . .
Модель сукцессии микоризы
anaschu 24.01.2026
Решили писать научную статью с неким РОманом
http://iceja.net/ математические сервисы
iceja 20.01.2026
Обновила свой сайт http:/ / iceja. net/ , приделала Fast Fourier Transform экстраполяцию сигналов. Однако предсказывает далеко не каждый сигнал (см ограничения http:/ / iceja. net/ fourier/ docs ). Также. . .
http://iceja.net/ сервер решения полиномов
iceja 18.01.2026
Выкатила http:/ / iceja. net/ сервер решения полиномов (находит действительные корни полиномов методом Штурма). На сайте документация по API, но скажу прямо VPS слабенький и 200 000 полиномов. . .
Расчёт переходных процессов в цепи постоянного тока
igorrr37 16.01.2026
/ * Дана цепь(не выше 3-го порядка) постоянного тока с элементами R, L, C, k(ключ), U, E, J. Программа находит переходные токи и напряжения на элементах схемы классическим методом(1 и 2 з-ны. . .
Восстановить юзерскрипты Greasemonkey из бэкапа браузера
damix 15.01.2026
Если восстановить из бэкапа профиль Firefox после переустановки винды, то список юзерскриптов в Greasemonkey будет пустым. Но восстановить их можно так. Для этого понадобится консольная утилита. . .
Сукцессия микоризы: основная теория в виде двух уравнений.
anaschu 11.01.2026
https:/ / rutube. ru/ video/ 7a537f578d808e67a3c6fd818a44a5c4/
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru