首页 \ 问答 \ 在jQuery中,试图让下一个项目不具有特定的类(In jQuery, trying to get next-item-not-having-a-specific-class)

在jQuery中,试图让下一个项目不具有特定的类(In jQuery, trying to get next-item-not-having-a-specific-class)

我试图在.focus div后面找到第一个没有(.hidden)的div。 在这个例子中,焦点是X2,并且我应该返回X5,因为它们是隐藏的,所以跳过X3和X4。

<div id='CONTAINER'>
    <div id='X1'>eks1</div>
    <div id='X2' class='focus'>eks2</div>
    <div id='X3' class='hidden'>eks3</div>
    <div id='X4' class='hidden'>eks4</div>
    <div id='X5'>eks5</div>
    <div id='X6'>eks6</div>
</div>

这似乎应该是一个非常简单的jquery问题,但我对这个东西相当陌生。


I'm trying to get at the first not(.hidden) div after the .focus div. In this example the focus is X2, and I should get back X5, skipping X3 and X4 because they are hidden.

<div id='CONTAINER'>
    <div id='X1'>eks1</div>
    <div id='X2' class='focus'>eks2</div>
    <div id='X3' class='hidden'>eks3</div>
    <div id='X4' class='hidden'>eks4</div>
    <div id='X5'>eks5</div>
    <div id='X6'>eks6</div>
</div>

This seems like it should be a pretty simple jquery question, but I'm fairly new to this stuff.


原文:https://stackoverflow.com/questions/10240517
更新时间:2023-02-04 12:02

最满意答案

知道有两个WebBrowser很重要。 一个用于Windows窗体,一个用于WPF。 下面的链接使用WPF。 http://www.dotnetfunda.com/articles/article840-working-with-webbrowser-in-wpf.aspx


It's important to know that there are two WebBrowser. One for Windows Forms and one for WPF. The link below uses the WPF one. http://www.dotnetfunda.com/articles/article840-working-with-webbrowser-in-wpf.aspx

相关问答

更多
  • 简答 您可以使用WPF WebBrowser控件中包含UI工具和API函数的所有块状特征。 要做到这一点,你应该: 创建一个HTML内容,其中包含引用Blocky js script标记,或者您希望从C#调用的方法,以及基于您的要求(例如工具箱和工作区)所需的HTML和XML内容。 您可以在运行时动态加载工具箱和工作区。 使用Navigate或NavigateToString内容加载到WebBrowser控件 如果您需要调用脚本,请使用WebBrowser控件的InvokeScript方法。 此外,为了能够 ...
  • 知道有两个WebBrowser很重要。 一个用于Windows窗体,一个用于WPF。 下面的链接使用WPF。 http://www.dotnetfunda.com/articles/article840-working-with-webbrowser-in-wpf.aspx It's important to know that there are two WebBrowser. One for Windows Forms and one for WPF. The link below uses the W ...
  • 在WPF控件中没有这样的事件,但是,您可以使用Loaded Event,或者您可以在WPF中托管Windows窗体控件并获取您想要的任何事件 请参阅在WPF中托管Windows窗体控件 There is no such Event in WPF control, However, you can use Loaded Event, or you can host the windows form control in WPF and get what ever events you want see Hos ...
  • 如果未设置ObjectForScripting,则window.external将为null 。 if(window.external === null) alert('ObjectForScripting is not set'); else alert('ObjectForScripting is set'); 要检查ObjectForScripting是否有特定的方法/属性,只需检查它是否未定义。 if(window.external !== null && typeof windo ...
  • 我这样做的方式是...... 使用HTTPRequest下载要呈现的页面的HTML文本。 使用HTML文本中的HTML敏捷包注入Java脚本。 如果你想使用jQuery,那么你必须首先jQuerify你的页面,然后绑定事件与你的DOM元素。 你也可以在脚本中调用你的c#函数和其他方法。 没有搞乱动态类型,因此也没有例外。 您也可以在此链接上使用扩展方法抑制WC中的脚本错误。 这可能会有所帮助。 The way I have done this is... Download HTML text of the ...
  • 将事件处理程序附加到WebBrowser.Navigated事件。 Silverlight应用程序中的关闭按钮使用: - HtmlPage.Window.Navigate(new Uri("about:blank", UriKind.Absolute)); 当Navigated事件在WPF中使用URL“about:blank”触发时,那么它将关闭控件。 Attach an event handler to the WebBrowser.Navigated event. Have the close bu ...
  • Visual Studio 2015 WPF应用程序中的以下解决方案适用于我。 首先,添加对Microsoft HTML COM库的引用。 这是在COM选项卡上,当您在项目中执行“添加引用”时。 然后添加代码:
    我想出的答案是Navigated事件。 包含Web浏览器的用户控件具有一个私有布尔值,用于确定是否允许导航。 如果是(通过用户控件的Navigate方法设置),则控件可以导航到新页面。 页面加载后,布尔值设置为false,表示禁用后退/前进。 在我的情况下,这会增加奖励:无法点击链接。 我不希望在浏览器控件中加载这些 - 我只希望这样可以查看在网格中选择的页面。 但是,右键单击链接仍然在新窗口中打开选项。 这可能不是最好的解决方案,但它对我有用。 The answer I have come up with ...
  • 您的初始页面OfflinePage.html来自本地文件系统,而您的XHR URL是一个Web地址。 WebBrowser禁止将此作为跨域安全限制。 您可以使用XDomainRequest来解决问题,但Web服务器应通过在响应中包含Access-Control-Allow-Origin: * HTTP标头来明确同意跨域请求。 有关HTTP访问控制(CORS)的更多信息,请参见此处 。 Your initial page OfflinePage.html comes from the local file s ...
  • 确保你的网页在IE中工作。 考虑使用CefSharp(基于铬)而不是webbrowser(基于IE)。 I have found a solution for my problem. I have to write the HTML-string as a file and navigate to it with the WebBrowser control. This is the new code of my method: StringBuilder htmlBuilder = new ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)