问题标签 [yui]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
2082 浏览

javascript - yui 或 yui3

YUI3准备好成熟了吗?它与 YUI 的优缺点是什么

0 投票
1 回答
898 浏览

yui - YUI TabView.get("tabs") => null: 竞争条件?

在我的“dom ready”函数中,我在 HTML 元素上创建了一个 TabView 并调用 tabview.getTab(0).blah()。不幸的是,我时不时地收到一个错误,即 tabView.get("tabs") 在我的 javascript 控制台(firefox)中返回 null。

tabview.getTab(0) 被实现为 tabs.get("tabs")[0]。

这种情况有时会发生,但不是每次都发生。有人解释为什么有时会发生这种情况吗?DOMReady 事件发生在整个 DOM 就位之后但在显示任何内容之前,对吗?

说到这一点,有时我会在其他一些选项卡中看到数据闪烁。对于我所希望的美好、干净的体验,这并不是一个好兆头。

这是 YUI 2.7.0/

0 投票
1 回答
791 浏览

javascript - 选择此项目后,如何使拆分按钮菜单项滚动到视图中?

我已经使用 YUI 2.6 一段时间了。现在,我意识到 YUI 的拆分按钮的行为不像标准的 select html 元素。选择一个项目后,再次显示列表时,它根本不会突出显示或滚动该项目到视图中。在最坏的情况下,如果我有 200 个项目,用户选择了第 100 个项目,当他/她想要更改他/她的选择时,他/她必须从头开始滚动。它根本不是用户友好的。与标准的 select html 元素不同,它会突出显示该项目并将其滚动到视图中。任何想法都非常感谢。

0 投票
1 回答
1239 浏览

javascript - YUI:取消窗口关闭事件时自定义消息浏览器显示

我有一个 YUI 应用程序。在某些情况下,我想在用户关闭窗口之前提醒他。因此我捕获窗口关闭事件并执行

浏览器显示一条标准消息:“您确定要离开此页面吗?按 OK 继续,取消停留在当前页面”。

如何自定义浏览器显示的消息?

0 投票
2 回答
903 浏览

javascript - JavaScript 习惯用法:创建一个函数只是为了调用它

我正在学习YUI,偶尔会看到这个成语:

为什么他们创建一个函数只是为了调用它?为什么不直接写:

例如看这里

0 投票
1 回答
1130 浏览

javascript - YUI 支持 rtl 语言

YUI 是否支持 rtl 语言?(rtl:从右到左,例如希伯来语或阿拉伯语)。

如果是这样,怎么做?我想显示一个菜单栏,其中不同的菜单项从右边距附近开始,然后向左移动。

0 投票
1 回答
391 浏览

events - YUI:在页面加载后在某些事件队列的顶部添加事件?

如何在页面加载后将新事件放在链接到对象的所有附加事件的顶部?

实际上,我有一个使用一些 YUI 函数来激活其行为的手风琴,现在在不修改 YUI 主函数的情况下,我需要一些用于调用 AJAX 例程的新函数。目前我正在尝试使用 Event.getListeners,但我不知道如何处理返回的对象。

问候

0 投票
6 回答
13992 浏览

yui - 如何使用不同的浏览器测试我的网页?

我刚刚发现了 Yahoo UI Reset CSS工具/文件,我正在我的网站上使用它。在我的机器上,我有 Internet Explorer 7 和 Firefox 3.01,我的网页在这两个浏览器上看起来是一样的。一个朋友正在使用 Internet Explorer 6,页面完全是一团糟。我有两个问题:

  1. 我在编写 CSS 方面有那么差/愚蠢吗?
  2. 如何在我的机器上使用不同的浏览器测试我的网页?
0 投票
3 回答
1291 浏览

css - Whats the correct CSS to apply to a YUI menu bar?

I am trying to figure out the best way to use CSS sprites as header images for a YUI menu control.

I have a CSS sprite with the following CSS :

How can I apply this to a YUI menu?

So far I've applied the navImg0, navImg1 etc. styles to the buttons.

They come up in the right position but with a few problems:

  • there are lines between the items and i need to ideal way to remove them
  • when i rollover the button the correct rollover works, but then if i roll off the menu and onto the main part of the screen the button disappears
  • the <a> tags under the <li> for each of the top level items doesnt work (theres no text inside anymore).

They have a lot of documentation about applying CSS but I couldn't find any examples of how to use CSS Sprites as images.

0 投票
2 回答
223 浏览

javascript - 如何从调用的函数中引用包含事件的元素?

如何从fireAlert()函数内部引用调用它的元素,而不必this通过链接作为参数传递?