another couple notes:

It is a good idea for jQuery to use the an #ID for the call $("#myol")
instead of $("OL").

Also.. If someone adds another OL somewhere on the page, the methods
you are applying will be applied to every other OL on the page. Which
may not do what you intended.

Using OL will cause jQuery to look over every element in the page
looking for OL elements.

Using the #ID maps to the window documentGetElementById() which is
much faster than DOM transversal.

Its not too big of a deal since your page is pretty lightweight, but
it is good practice to use #ID.

Also, using DIV before the ID $("DIV#arrow") is not really necessary.

Since jQuery 1.3 the selector engine works from the bottom up,(I hope
I am saying that right)-- so adding the DIV is just extra code.

Hope that helps!

On May 26, 4:17 am, Pepperman <chorno...@gmail.com> wrote:
> Try this. It is using jQuerys offset() method to get the current
> elements position.
>
> This way you do not have to create a class for each position you need
> to to be in. Let JQuery figure that part out.
>
> You will probably have to tweak the css offset a bit to get it to sit
> exactly where you want over the ul.
> eg.
>  top: offset.top - 15,
>  left: offset.left - 25
>
> <script type="text/javascript">
> $("#myol").everyTime(4000, "myrotate", function() {
>
>         var $this = $(this), $thisli = $this.find("li"), offset;
>
>         $this.data("currentshow", $this.data("currentshow") || 0);
>
>          offset = $thisli.removeClass("on").eq($this.data("currentshow"))
>                   .addClass("on")
>                           .offset();
>
>         $("#arrow")
>           .css({
>              top: offset.top - 15,
>              left: offset.left - 25
>              })
>       .show();
>
>         $this.data("currentshow", $this.data("currentshow") ===
> $thisli.length ? 0 : $this.data("currentshow") + 1);});
>
> </script>
>
> On May 26, 12:21 am, MauiMan2 <cmzieba...@gmail.com> wrote:
>
>
>
> > Hmm, I think that might work. Now just have to tinker w/ it a bit to
> > get the arrow to animate as well. Thanks, Pepperman!
>
> > On May 25, 7:57 pm, Pepperman <chorno...@gmail.com> wrote:
>
> > > I had to do something like this recently.
>
> > > Try this:
>
> > > <ol id="myol">
> > >         <li>We establish, through the Secretary of State, a Corporation in
> > > any state you choose as your home base of operations.</li>
> > >         <li>We customize a 401k plan that can invest in your corporate 
> > > stock
> > > and traditional investments.</li>
> > >         <li>Our experts help you roll over your retirement funds into the
> > > 401k plan that you control.</li>
> > >         <li>The 401k makes a direct purchase of your corporate stock,
> > > infusing your corporation with cash.</li>
> > >         <li>We help you set up a Corporate Bank Account with checkbook
> > > control of your corporate funds.</li>
> > > </ol>
>
> > > <script type="text/javascript">
> > > $("#myol").everyTime(4000, "myrotate", function() {
>
> > >         var $this = $(this), hlen = $this.find("li").length;
>
> > >         $this.data("currentshow", $this.data("currentshow") || 0);
>
> > >         $this.find("li").removeClass("on")
> > >                  .eq($this.data("currentshow"))
> > >                  .addClass("on");
>
> > >         $this.data("currentshow", $this.data("currentshow") === hlen ? 0 :
> > > $this.data("currentshow") + 1);});
>
> > > </script>
>
> > > On May 25, 5:28 pm, MauiMan2 <cmzieba...@gmail.com> wrote:
>
> > > > I've used the jQuery Timers plugin (http://plugins.jquery.com/project/
> > > > timers) to animate through my client's "five steps" on this 
> > > > page:http://www.cmzmedia.com/irarollover/butistherea way to get it to
> > > > continuously loop through the animation? The documentation page
> > > > (http://jquery.offput.ca/timers/) doesn't seem to cover anything like
> > > > that. Thanks in advance.

Reply via email to