必须更改选项卡才能正确显示 HTML
我用jCarousel创建了什么?一个旋转木马。然后,老板希望我创建一些选择器,以便用户可以选择不同的结果列表(就好像它是相同的轮播,但显示不同的结果)。
我使用的策略很简单:我创建了多个轮播并隐藏它们。仅会出现选定的轮播。
它工作得很好,除了一件事:在 Firefox(现在是 IE8)中,我被迫更改到浏览器的另一个选项卡,然后返回或更改窗口大小(如果我想看到它应该看到的内容)。
当然,这不是用户猜测甚至容忍的事情。
编辑
这是我想要实现的目标:
这是错误的: 这是列表首次加载时、调整窗口大小之前或我在浏览器中选择其他选项卡时的外观
当我更改浏览器中的选项卡或更改窗口大小时,它开始正常工作。
我相信,如果我调用一个事件的处理程序(例如调整窗口大小、制表符更改或类似的东西)。你怎么认为?
更多数据
:我不确定这是否与案例相关,但我正在使用 jCarousel。宽度不正确的元素是相应的无序列表,其中包含您在上图中看到的元素。
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 browser
When 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您尝试页面刷新并打结怎么办
what if you try a page refresh and tie
这段代码解决了这个问题:
希望这对遥远的未来的人有帮助。
This code solved the problem:
Hope this helps someone in a far far far way future.
对在我完成之前提交的答案表示歉意。我的意思是说将页面刷新与诸如 top.location.href 之类的脚本联系起来 - 不确定 jquery 的等效项。
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.