必须更改选项卡才能正确显示 HTML

发布于 2024-10-03 12:46:41 字数 707 浏览 5 评论 0原文

我用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:
Second tab selected
First tab selected

Here's what is wrong:
The problem
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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空‖城人不在 2024-10-10 12:46:41

如果您尝试页面刷新并打结怎么办

what if you try a page refresh and tie

笛声青案梦长安 2024-10-10 12:46:41

这段代码解决了这个问题:

<script type="text/javascript">
    $(window).resize();
</script>

希望这对遥远的未来的人有帮助。

This code solved the problem:

<script type="text/javascript">
    $(window).resize();
</script>

Hope this helps someone in a far far far way future.

梦境 2024-10-10 12:46:41

对在我完成之前提交的答案表示歉意。我的意思是说将页面刷新与诸如 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文