jQuery UI 滑块在 Opera 中无法正常工作?

发布于 2024-10-27 12:06:25 字数 2227 浏览 4 评论 0原文

所以,我对此很陌生,一月份开始学习网页设计,并且仍在我的第一个网站上工作,但我遇到了 UI 滑块和 Opera 的问题,我似乎无法弄清楚。

每当单击 UI 句柄,或者更准确地说按下时,主窗口“largewindow”就会由于某种原因跳转到“top:0”?

我有以下代码:

<ul id="largewindow">
<li class="smallwindow">
    <ul class="first">
        <li class="logo"></li>
            <li class="scrollerwindow">
                <dl class="docwindow">
                    <dt class="somethingthumb1"><a href="/link/to/my/firstfile.html"></a></dt><dd>This is my first file</dd>
                    <dt class="somethingthumb2"><a href="/link/to/my/secondfile.html"></a></dt><dd>This is my second file</dd>
                </dl>
            </li>
        <li class="sliderbg"></li>
        <li id="slider1" class="slider"></li>

    </ul>
</li>

#largewindow {position: absolute; margin:0; padding:0; height: 6400px; width: 2250px; top:0; left:0; z-index:92}
#largewindow > li{position:relative; float:left; height:500px; width:2250px; list-style:none;}
.first {height:500px; width:750px; float: left;}
.logo {position: relative; height:60px; width:410px; top:27px; left: 160px; z-index:103;}
.docwindow {position: relative; height: 175px; width: 533px; top:-6px; left:0px; overflow: hidden;}
.scrollerwindow {position:relative; height: 175px; width:537px; top: 56px; left:92px; z-index: 99;}
.sliderbg {position:relative; top:54px; left: 80px; height:10px; width: 555px;}
.slider {left:78px; top:40px; width: 506px; height: 10px; margin: 5px; position: relative; z-index:199;}
.ui-slider-handle {width: 40px; height: 8px; position: absolute; top: 1px; border: none; outline:none; z-index:199;}
.ui-slider-handle:hover {background: #someothercolor;}

我已经尝试过将所有内容从脚本删除为这样:

$("#slider1").slider();

但它仍然如此,我一生都无法弄清楚。 如果我将“largewindow”的位置设置为固定,它可以解决 Opera 中的问题,但会在所有其他浏览器中创建一堆新问题。 我可能可以通过使用浏览器特定的 css 规则来解决这个问题,但是由于我在网上找不到有关此问题的任何信息,我猜这只是我作为新手而错过了一些简单的东西。

我在这里上传了一个现实生活中的例子: http://www.boatinfo.no​​/lib/library .html

So, I'm new to this, started learning web design in January, and still working on my first site, but I have encountered problems with the UI slider and Opera that I can't seem to figure out.

Whenever the UI handle is clicked, or more accurately pressed down, the main window "largewindow" jumps to "top:0" for some reason?

I have the following code:

<ul id="largewindow">
<li class="smallwindow">
    <ul class="first">
        <li class="logo"></li>
            <li class="scrollerwindow">
                <dl class="docwindow">
                    <dt class="somethingthumb1"><a href="/link/to/my/firstfile.html"></a></dt><dd>This is my first file</dd>
                    <dt class="somethingthumb2"><a href="/link/to/my/secondfile.html"></a></dt><dd>This is my second file</dd>
                </dl>
            </li>
        <li class="sliderbg"></li>
        <li id="slider1" class="slider"></li>

    </ul>
</li>

#largewindow {position: absolute; margin:0; padding:0; height: 6400px; width: 2250px; top:0; left:0; z-index:92}
#largewindow > li{position:relative; float:left; height:500px; width:2250px; list-style:none;}
.first {height:500px; width:750px; float: left;}
.logo {position: relative; height:60px; width:410px; top:27px; left: 160px; z-index:103;}
.docwindow {position: relative; height: 175px; width: 533px; top:-6px; left:0px; overflow: hidden;}
.scrollerwindow {position:relative; height: 175px; width:537px; top: 56px; left:92px; z-index: 99;}
.sliderbg {position:relative; top:54px; left: 80px; height:10px; width: 555px;}
.slider {left:78px; top:40px; width: 506px; height: 10px; margin: 5px; position: relative; z-index:199;}
.ui-slider-handle {width: 40px; height: 8px; position: absolute; top: 1px; border: none; outline:none; z-index:199;}
.ui-slider-handle:hover {background: #someothercolor;}

i have tried cutting everything from the script to just this:

$("#slider1").slider();

And it still does it, cant for the life of me figure it out.
If I set position of "largewindow" to fixed it solves the problem in Opera, but creates a bunch of new ones in all other browsers.
I could probably get around the problem by using browser specific css rules, but since I can't find any information on this problem online I'm guessing it's just me being a newbie and missing something simple.

I've uploaded a real life example here: http://www.boatinfo.no/lib/library.html

?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

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

评论(1

寄居者 2024-11-03 12:06:25

我也有同样的问题。到目前为止,我已经追踪到这样一个事实:单击滑块手柄会将焦点转移到作为手柄的 A 元素,此操作会导致 Opera 向上滚动该元素。现在要防止这种情况发生,嗯!

-

因此,我确认将焦点放在可滚动区域中的任何旧链接似乎会触发链接元素的scrollIntoView(true) 行为。然后我将 Opera 升级到 v11.10,这个 bobo 就消失了。我以为我太聪明了。

I'm having the same problem. So far, I've tracked it down to the fact that clicking a slider handle gives the focus to the A element that is the handle, and this action causes Opera to scroll the element up. Now on to preventing this, eh!

--

So, I confirmed that giving focus to any old link in a scrollable area appears to trigger the link element's scrollIntoView(true) behaviour. Then I upgraded Opera to v11.10 and this bobo went away. And I thought I was soooo smart.

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