My callback goes as follows:
function mycarousel_initCallback(carousel)
{
?php if($slider == 'auto') { ?
// Disable autoscrolling if the user clicks the prev or next
button.
carousel.buttonNext.bind('click', function() {
carousel.startAuto(0);
});
carousel.buttonPrev.bind('click', function() {
carousel.startAuto(0);
});
// Pause autoscrolling if the user moves with the cursor over the
clip.
carousel.clip.hover(function() {
carousel.stopAuto();
}, function() {
carousel.startAuto();
});
?php } ?
};
Next I have a function which handles the ajax stuff for the cookie and
the success output:
function getscrolltype(what) {
$.get('autoscroll.php',{scrollmodus: what},function(returned_data)
{
if(what == auto) {
$(#autoscroll_output).html(Automatisch
scrollen);
}
if(what == manuell) {
$(#autoscroll_output).html(Manuell
scrollen);
}
}
);
}
The switch I realised as follows:
div id=autoscroller
h4Projektfenster:/h4
ul
lia href=# onclick=getscrolltype('auto');
id=autoscrollAutomatisch scrollen/a/li
lia href=# onclick=getscrolltype('manuell');
id=manuellscrollManuell scrollen/a/li
/ul
Gewählt: span id=autoscroll_output?php if
($slider==auto){
echo Automatisch scrollen;
} else { echo Manuell scrollen;
}?/span
/div
Finally my little page autoscroll.php that sets the php cookie and
responds:
?php
require_once('includes/config.inc.php');
$slider= $_GET['scrollmodus'];
if($slider != auto $style != manuell){
$slider = manuell;
}
setcookie(info_autoscroll, $slider, time()+(604800 *
$styleduration));
echo $slider;
?
So what I trying to reach without sucess is to start/stop autoscroll
from the javascript function getscrolltype above:
function getscrolltype(what) {
$.get('autoscroll.php',{scrollmodus: what},function(returned_data)
{
if(what == auto) {
$(#autoscroll_output).html(Automatisch
scrollen);
*** Start the Autoscroll of my
jcarousel now ***
}
if(what == manuell) {
$(#autoscroll_output).html(Manuell
scrollen);
*** Stop the Autoscroll of my
jcarousel now ***
}
}
);
}
I tried several things, but nothing worked out for me. The PHP part
works well, but it obvious only comes out, if the Visitor clicks on a
link. What I want is to start/stop Autoscroll immediately. Is that
possible?
Hope I described my Problem a lot better. Sorry for my English, I am
german.
Any help is greatly apreciated, I keep the fingers cross, that
somebody couls help me out of this. Thank you.