views:

362

answers:

1

Hi,

I am currently working with a tab menu which cycles through automatically. Once I mouseover one of the tabs the "rotation" should stop on the selected tab and when I mouseout it should continue rotating from the selected tab item.

$(document).ready(function() {

$("#featured > ul").tabs({ fx: { opacity: "toggle"} }).tabs("rotate", 1000, true);

$("#featured > ul").mouseover(function() {
    $(this).tabs({ event: 'mouseover', fx: { opacity: "toggle"} }).tabs("rotate", 0);
})

$("#featured > ul").mouseout(function() {
    $(this).tabs("rotate", 1000);
})
});

At the moment the when MouseOver the cycle stops but does not select the correct item, once I mouseOut then MouseOver again the functionality works perfectly! My issue lies where on first mouseOver the code doesnt seem to be loading correctly?

Any ideas? Help will be really appreciated.

Thanks again for your time..

A: 

Try this:

$("#featured > ul").mouseover(function() {
    $(this).tabs("abort");
    $(this).tabs({ event: 'mouseover', fx: { opacity: "toggle"} }).tabs("rotate", 0);
    $(this).tabs("select", this.id); 
});
karim79
Thanks but it doesnt seem to do the trick. When selecting it seems to select the first menu item.it looks like the "this.id" is not returning a value.Any idea?
I have the url here of the issue previously mentioned. What do you think?http://michaelhall.makemedia-test.com/default_test.aspx