X   Сообщение сайта
(Сообщение закроется через 3 секунды)



 

Здравствуйте, гость (

| Вход | Регистрация )

Открыть тему
Добавить ответ в эту тему
> Помогите совместить JavaScript код! пожалуйста! очень нужно!
Adrian_hb
Adrian_hb
Topic Starter сообщение 10.3.2012, 3:56; Ответить: Adrian_hb
Сообщение #1


<!-- - - Sound Manager 2 - - -->
<script src="javascripts/soundmanager2.js"></script>
<script>
soundManager.flashVersion = 8,9,10;
soundManager.url = 'javascripts/soundmanager2.swf';
soundManager.useFlashBlock = false;
soundManager.debugMode = false;
soundManager.waitForWindowLoad = true;
soundManager.useHTML5Audio = true;
soundManager.onready(function() {
var mySound = soundManager.createSound({
id: 'podcast-player',
url: 'http://cs4527.vk.com/u56363091/audio/94647e45ac57.mp3',
autoLoad: false,
autoPlay: false,
volume: 30,
onload: function() {

$('#podcast-play_pause').removeClass('podcast-play').addClass('podcast-pause');
},
onpause: function() {
$('#podcast-play_pause').removeClass('podcast-pause').addClass('podcast-play');
},
whileloading: function() {
document.getElementById("podcast-progress-load").style.width=(((this.bytesLoaded/this.bytesTotal)*100)+'%');
},
whileplaying: function() {

// Конвертация времени
milliSecs = this.position
msSecs = (1000)
msMins = (msSecs * 60)
msHours = (msMins * 60)
numHours = Math.floor(milliSecs/msHours)
numMins = Math.floor((milliSecs - (numHours * msHours)) / msMins)
numSecs = Math.floor((milliSecs - (numHours * msHours) - (numMins * msMins))/ msSecs)
if (numSecs < 10){
numSecs = "0" + numSecs
if (numSecs > 10)
numSecs = "0" + numSecs
}

resultString = /*numHours + ":" + */numMins + ":" + numSecs
$('#podcast-current-time').html(resultString);

milliSecs = this.position
msSecs = (1000)
msMins = (msSecs * 60)
msHours = (msMins * 60)
numHours = Math.floor(milliSecs/msHours)
numMins = Math.floor((milliSecs - (numHours * msHours)) / msMins)
numSecs = Math.floor((milliSecs - (numHours * msHours) - (numMins * msMins))/ msSecs)
if (numSecs < 10){
numSecs = "0" + numSecs
if (numSecs > 10)
numSecs = "0" + numSecs
}
resultString = numMins + ":" + numSecs
$('#podcast-duration').html(resultString);

// Значения для прогресс-бара
$("#podcast-progress-bar").slider("option", "value", this.position);
$("#podcast-progress-bar").slider("option", "max", this.durationEstimate);
},
});

// Play/Pause
$('#podcast-play_pause').click(function () {
soundManager.togglePause('podcast-player');
});


// Громкость
$("#podcast-volume-bar").slider({
range: "min",
value: 30,
min: 0,
max: 100,
step: 1,
animate: true,
slide: function(event, ui) {
soundManager.getSoundById('podcast-player').setVolume(ui.value);
}
});
// Включение и выключение громкости
$('#podcast-mute').click(function(){
soundManager.getSoundById('podcast-player').setVolume(0);
$("#podcast-volume-bar").slider('value', 0);
return false;
});
$('#podcast-unmute').click(function(){
soundManager.getSoundById('podcast-player').setVolume(100);
$("#podcast-volume-bar").slider('value', 100);
return false;
});

// Прогресс
$("#podcast-progress-bar").slider({
range: "min",
min: 0,
step: 1,
animate: true,
slide: function(event,ui) {
soundManager.getSoundById('podcast-player').setPosition(ui.value);
}
});
});
</script>
<!-- - - - - - - - - - - -->

<!-- - - - Playlist - - - -->
<script>
function initMenu() {
$('#podcast-list .podcast-list-item-more').hide();
//$('#podcast-list .podcast-list-item-more:first').show();
$('#podcast-list article a').click(
function() {
var checkElement = $(this).next();
if((checkElement.is('.podcast-list-item-more')) && (checkElement.is(':visible'))) {
return false;
}
if((checkElement.is('.podcast-list-item-more')) && (!checkElement.is(':visible'))) {
$('#podcast-list .podcast-list-item-more:visible').slideUp('normal');

$('#podcast-list article a').slideDown('fast'); //fix
$(this).slideUp('fast'); //fix

checkElement.slideDown('fast');
return false;
}
}
);
}
$(document).ready(function() {initMenu();});
</script>
<!-- - - - - - - - - - - -->

<!-- - - - Nano Scroller - - - -->
<script src="jquery.nanoscroller.js"></script>
<script>
$(function(){
$('.nano').nanoScroller();
});
</script>
<!-- - - - - - - - - - - - - - -->
0
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
VasyOk
VasyOk
сообщение 13.3.2012, 12:01; Ответить: VasyOk
Сообщение #2


Не совсем понятно. Что сделать то нужно? Сбить единое целое JS ?
Вернуться в начало страницы
 
Ответить с цитированием данного сообщения
Открыть тему
Добавить ответ в эту тему
Быстрый ответ
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0


Свернуть

> Похожие темы

  Тема Ответов Автор Просмотров Последний ответ
Открытая тема (нет новых ответов) Нужно разносить телеграм каналы по разным аккаунтам?
9 Mixatraider 1817 20.3.2024, 18:34
автор: Rebex
Горячая тема (нет новых ответов) Тема имеет прикрепленные файлыСколько времени нужно для раскачки нового сайта?
29 metvekot 7869 8.3.2024, 15:41
автор: malamut
Открытая тема (нет новых ответов) Нужно ли закрывать ненужные страницы тегом noindex, follow?
8 noviktamw 2834 2.3.2024, 12:53
автор: toplinks
Открытая тема (нет новых ответов) Нужно сделать репост статей в соц сети
1 HavingingWorld 2395 27.2.2024, 2:15
автор: AndrePro
Открытая тема (нет новых ответов) Помогите вспомнить рекламного бота Телеграм для обмена рекламой
0 Mixatraider 692 21.2.2024, 23:42
автор: Mixatraider


 



RSS Текстовая версия Сейчас: 29.3.2024, 12:25
Дизайн