Kod
function pla(x) {
var x = 3000;
$('#slideshow').before('<ul id="nav">').cycle({
fx: 'turnDown',
speed: 'fast',
timeout: x,
pager: '#nav',
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#"><img src="' + slide.src + '" /></a></li>';
}
});
}
var x = 3000;
$('#slideshow').before('<ul id="nav">').cycle({
fx: 'turnDown',
speed: 'fast',
timeout: x,
pager: '#nav',
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#"><img src="' + slide.src + '" /></a></li>';
}
});
}
wywołuję
<body onload="pla(3000)">
I tu działa.
Mam też takie linki
<a href="#" onclick="pla(3000)">3</a>
<a href="#" onclick="pla(6000)">6</a>
<a href="#" onclick="pla(9000)">9</a>
Po kliknięciu zdjęcia powinny się przesuwać wolniej ale wtedy coś się sypie raz sie pokazuję potem nic ....
Fajnie by było jak by ktoś też podpowiedział jak dodać tam link play/stop chodź tutaj mogę dać dla paly standardową wartość a dla stop np 1000000 (wiem, że są wbudowane funkcje w cycle)
ma ktoś pomysł jak to zrobić?
jak by ktoś potrzebował:
Kod
function ct(x) {
document.getElementById("time_out").value = x;
return;
}
$(document).ready(function() {
$('#slideshow').before('<ul id="nav">').cycle({
fx: 'turnDown',
speed: 'fast',
timeoutFn: function(currElement, nextElement, opts, isForward) {
var duration = document.getElementById("time_out").value;
return duration * 1000;
},
pager: '#nav',
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#"><img src="' + slide.src + '" /></a></li>';
}
});
});
document.getElementById("time_out").value = x;
return;
}
$(document).ready(function() {
$('#slideshow').before('<ul id="nav">').cycle({
fx: 'turnDown',
speed: 'fast',
timeoutFn: function(currElement, nextElement, opts, isForward) {
var duration = document.getElementById("time_out").value;
return duration * 1000;
},
pager: '#nav',
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#"><img src="' + slide.src + '" /></a></li>';
}
});
});