我在 html 代码“ ul” 和“ li” 中有一个定制的下调, 当用户点击“ ul” 头时, 我显示选项, 当用户点击菜单区域外时, 我想隐藏这些元素 。
诸如此类的事情有可能 与 Javascript/YUI 不是Jquery?
我在 html 代码“ ul” 和“ li” 中有一个定制的下调, 当用户点击“ ul” 头时, 我显示选项, 当用户点击菜单区域外时, 我想隐藏这些元素 。
诸如此类的事情有可能 与 Javascript/YUI 不是Jquery?
我不是UI的人,所以我猜这个可能写得更好 但我已经测试过了,效果也不错
单击文档时隐藏下调 :
Y.one(document).on("click", function(){
Y.one("#menu").hide();
});
防止点击 ul
从传播到 document
:
Y.one("#menu").on("click", function(e){
e.stopPropagation();
});
如果访问者单击任何地方, 点击会泡到 < code> document code> 上, 并隐藏菜单。 如果他们点击菜单, 事件将无法泡到 < code> document code > 上, 因此菜单不会隐藏 。
网站:http://jsfiddle.net/nHnZT/" rel="nofolp">http://jsfiddle.net/nHnZT/
use(事件外出)
增加对“外外”活动的支持。 详情请见用户指南 : http://yyyilibrary.com/yui/docs/event/outside. html
How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.
I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...
I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.