SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Port Sunlight
    Posts
    815
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with adding classes

    http://www.equestriansuppliesshop.co...ch_query=ariat

    The above site is where I have an issue. I need to make the boxes line up perfectly, so I have added margin-right to all the LI elements, but for the 3rd element in each line I have added a class called 'bookend' and in the CSS this gets no margin-right, and it fits perfectly.

    However, if I select the 2nd page in the pagination, it doesn't apply the class to the 3rd element.

    This is my jQuery:

    Code JavaScript:
    $(document).ready(function () {	
    	$('ul.ProductList li:nth-child(3n-0)').addClass('bookend');
    });

    Any ideas? Really stressing me out.

  2. #2
    SitePoint Guru
    Join Date
    Aug 2004
    Location
    Port Sunlight
    Posts
    815
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, I'm guessing this forum isn't that useful anymore. Can anyone recommend a good jQuery/JavaScript forum?

  3. #3
    SitePoint Evangelist
    Join Date
    Jul 2007
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would running the jQuery statement again once the new page is displayed help?

  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Just because you didn't get the help you didn't want doesn't immediately make the forum "not that useful" any more. Seems a bit ungrateful, especially considering how many times you have got help here in the past.

    r51 is right, it seems you need to run that statement again once your Ajax request has loaded the 2nd page items.

    By the way, you should keep the first page once you've gone to the 2nd. That way if I click the "previous" link, I don't have to wait for the Ajax request to happen for something that I was just looking at.

    Also, you might want to check out your class names for the list items. The further down you go the more they look like this:

    HTML Code:
    <li class="EvenOddEvenOddEvenOddEvenOddEvenOddEven">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •