of course it won't work, is improper use of index(),

replace index() with eq()

Suggestion:
instead of posting each and every thought and failed function you have every 2 minutes, this example could have been created in a very simple test page to get the methods and syntax sorted out. Would have saved us watch the floundering on each and every step of your grief. Other example you tried $("#mycarousel > li[" + i + "]") is syntax problem with several workarounds including :eq()

Building simple test pages is one of the best ways to learn jquery IMO. Keeping a simple template including link to jquery google source, and a $(document)ready built in you can build a test page in any directory in almost no time and debug in Firebug


expresso wrote:
tried this but doesn't look like you can do this

$("#mycarousel > li").index(i).css("margin-right", "0px").css("padding-
right", "6px");

On Jul 8, 9:48 pm, expresso <dschin...@gmail.com> wrote:
  
Like something like this

$("#mycarousel > li[" + i + "]").css("margin-right", "0px").css
("padding-right", "6px");

On Jul 8, 9:46 pm, expresso <dschin...@gmail.com> wrote:

    
Thanks.  I wonder if you can even access an <li> by index?
      
On Jul 8, 9:35 pm, MorningZ <morni...@gmail.com> wrote:
      
Why wouldn't you just use:
        
http://docs.jquery.com/Selectors/last
        
$("#mycarousel > li:last").css("property", "value");
        
On Jul 8, 10:17 pm, expresso <dschin...@gmail.com> wrote:
        
If I have the following:
          
<div class="jcarousel-clip jcarousel-clip-horizontal" style="width:
459px; height: 220px;">
    <ul id="mycarousel" class="jcarousel-list jcarousel-list-
horizontal" style="height: 220px; width: 918px; left: 0px;">
        <li class="jcarousel-item jcarousel-item-horizontal jcarousel-
item-1 jcarousel-item-1-horizontal" jcarouselindex="1">
        </li>
        <li class="jcarousel-item jcarousel-item-horizontal jcarousel-
item-2 jcarousel-item-2-horizontal" jcarouselindex="2">
        </li>
        <li class="jcarousel-item jcarousel-item-horizontal jcarousel-
item-3 jcarousel-item-3-horizontal" jcarouselindex="3">
        </li>
</ul>
</div>
          
Trying to figure out how I can do a .each on each <li> and then add an
additional style to the last <li> in the list.
          

  

Reply via email to