views:

157

answers:

2

I have this two uls:

<ul actualpage="0" id="lastcompanieslist" hideable="true" upperpage="1">
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">1</
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">2</li>
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">3</li>
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">4</li>
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">5</li>
   <li page="1" style="display: none;"><img src="/images/OrangeArrow.jpg">6</li>
   <li page="1" style="display: none;"><img src="/images/OrangeArrow.jpg">7</li>
</ul>


<ul actualpage="0" id="lastmodifiedcompanies" hideable="true" upperpage="1">
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">1</li>
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">2</li>
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">3</li>
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">4</li>
   <li page="0" style="display: none;"><img src="/images/OrangeArrow.jpg">5</li>
   <li page="1" style="display: none;"><img src="/images/OrangeArrow.jpg">6</li>
   <li page="1" style="display: none;"><img src="/images/OrangeArrow.jpg">7</li>
   <li page="1" style="display: none;"><img src="/images/OrangeArrow.jpg">8</li>
   <li page="1" style="display: none;"><img src="/images/OrangeArrow.jpg">9</li>
</ul>

Here is my javascript code that is executed when i click the button:

function Paging(ul)
{
  //ul is the jquery ul that should be paged
  ul.find('li[page!=' + $($(this).parent()).attr('actualpage') + ']').fadeOut(500,
  function() 
  {
      ul.find('li[page=' + $($(this).parent()).attr('actualpage') + ']').fadeIn(500);
  }
  );
}

Im trying to fadeout the LI elements depending on the current page number (this number is stored in the attribute 'actualpage' of the parent UL, and after fadein those LI elements whose page matches with the actualpage attribute of the parent UL.

The effect is working but with flickering, do you know why?

Thanks in advance.

Jose

+1  A: 

could be a lack in browser performance , can we see an example or the information on which browser you testet, if you only tested on one, try another and lets see if it flickers the same on both :)

edit Now i know whats the problem, your pictures have to be positioned absolute so the are one over the other. i'm pretty sure thats the problem . just try adding position: relative to your ul and position: absolute to your li this will solve the problem i hope

Nexum
I tested in all browsers, and its like the items that have to disappear, start to do it, but once they dissapear, during some milliseconds, the height space of this dissapeared items is mantained...
Josemalive
Thanks for the info Nexum... Unfortunately didnt worked. I will try a workaround...Best Regards.Jose
Josemalive
are you sure ? it works for me, doing exactly the same thing on one of my websites... make sure every li is on top of the other (simply by setting all to display: block
Nexum
Yes, Nexux, you're right, but if i add a position absolute to my li elements all appears overlapped. How could i separate each one?
Josemalive
A: 

Have you tried to set fixed width to the li elements?
Maybe the flickering effect is caused by the fact that javascript is trying to asume dimensions of the boxes with a set of functions that sometimes is not very precise.

markcial
Thanks for the advice markcial, i will try and i tell you.Greetings.Jose
Josemalive