Have to change tabs in order to HTML appear properly
I have used jCarousel to create what? A carousel. Then, the boss wanted me to create some selectors so that the user could select different lists of the results (as if it were the same carousel, but showing different results).
The strategy I used was simple: I created multiple carousels and hide them. Only the selected carousel will appear.
It works fine except for one thing: In Firefox (and now in IE8) I am forced to change to another tab of the browser and then get back or change the window size if I want to to see it the it should.
Of course, this is not the kind of thing that a user guesses or even tolerates.
EDIT
Here's what I am trying to achieve:
Here's what is wrong:
This is the appearance of the list when it is first loaded and before the window is re-sized or I select some other tab in the browserWhen I change tabs in the browser or change the size of the window, it starts working correctly.
I believe that if I call and an handler for an event (like resize window, tabchanged or something like that). What do you think?
More data
: I am not sure if this will be relevant to the case, but I am using jCarousel. The element that an incorrect width is the corresponding开发者_运维知识库 unordered list that contains the elements that you see in the images above.
what if you try a page refresh and tie
This code solved the problem:
<script type="text/javascript">
$(window).resize();
</script>
Hope this helps someone in a far far far way future.
Apologies the answer submitted before I could finish. I meant to say tie a page refresh to the script such as top.location.href - not sure of the jquery equivalent.
精彩评论