Bootstrap - 下拉菜单不工作?(Bootstrap - dropdown menu not working?)
我的Bootstrap下拉菜单似乎没有工作 - 任何人都可以提醒我这个问题? 现在它显示下拉列表,但点击它什么都不做。 谢谢!
JS:
$(document).ready( function() { $('.dropdown-toggle').dropdown(); });
HTML:
<div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container" style="width: auto;"> <a class="brand" style="text-indent: 3em" href="#"> Title </a> <ul class="nav"> <li><a href="#">Profile</a></li> <li class="active"><a href="#">Statistics</a></li> <li><a href="#">Reader</a></li> <li class="dropdown" id="menu1"> <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1"> Options <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div> </div> </div>
My dropdown menu in Bootstrap doesnt appear to be working - can anyone alert me to the problem? Right now it displays the dropdown, but clicking it does nothing. Thanks!
JS:
$(document).ready( function() { $('.dropdown-toggle').dropdown(); });
HTML:
<div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container" style="width: auto;"> <a class="brand" style="text-indent: 3em" href="#"> Title </a> <ul class="nav"> <li><a href="#">Profile</a></li> <li class="active"><a href="#">Statistics</a></li> <li><a href="#">Reader</a></li> <li class="dropdown" id="menu1"> <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1"> Options <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div> </div> </div>
原文:https://stackoverflow.com/questions/9529574
最满意答案
尝试跟随,使用dcssSelector识别元素,然后提取“ttl”属性:
driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")).getAttribute("ttl");
**更新:**
String[] data = driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")).getAttribute("ttl").split("<br/>");
然后,您可以分别读取数据[0],数据[1],数据[2]以获得所需的输出。
获得第二个DIV元素:
driver.findElement(By.cssSlector("div:nth-child(2) map area:nth-child(6)")).getAttribute("ttl");
try following, which uses dcssSelector to identify the element and then extract "ttl" attribute:
driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")).getAttribute("ttl");
** UPDATE: **
String[] data = driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")).getAttribute("ttl").split("<br/>");
Then you can read data[0], data[1], data[2] separately to get desired output.
to get 2nd DIV element :
driver.findElement(By.cssSlector("div:nth-child(2) map area:nth-child(6)")).getAttribute("ttl");
相关问答
更多-
没有必要进入字符串的地方,如果你有一个十进制值,这可能是尴尬的。 function RoundedMax(a) { var mx = Math.max.apply(Math, a); if (mx == 0) {return 0}; var size = Math.floor(Math.log(Math.abs(mx)) / Math.LN10); var magnitude = Math.pow(10, size); var yMax = Math.ceil(mx ...
-
你的解决方案非常好。 它基本上是一个在获得K元素后停止的堆栈 ,从而改善了从O(NlogN) (完整排序)到O(N + KlogN)的运行时间。 这里N = 1000000且K = 10000。 但是,您最初不应该对堆执行N次插入,因为这将采用O(NlogN) - 而是使用heapify操作,该操作在线性时间内将数组转换为堆。 如果不需要对K数进行排序,则可以使用选择算法找到线性时间内的第K个最大数,然后输出大于它的所有数。 这给出了O(n)解。 Your solution is mostly good. ...
-
尝试跟随,使用dcssSelector识别元素,然后提取“ttl”属性: driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")).getAttribute("ttl"); **更新:** String[] data = driver.findElement(By.cssSlector("div.mstrmojo-DocXtabGraph map area:nth-child(6)")) ...
-
我确实在这篇文章上提出了一些建议并创建了一个关于城市,州的索引。 它确实没有帮助我的表现,但另一件事最终得到了帮助。 通过在两列上放置一个索引,我发现的修复很可能也会更有效。 然而,解决方案是添加USE INDEX: http://dev.mysql.com/doc/refman/5.1/en/index-hints.html 通过定义要使用的索引,查询时间从30秒减少到1.5秒。 我不知道为什么会有效,但确实如此。 I did follow some advice on this post and cre ...
-
你不必编程任何东西。 这甚至可以在Selenium IDE中进行(猜测你现在正在使用它),只记录一个案例。 请参阅以下资源以帮助您: 如何在Selenium IDE中使用循环 ' 如何在Selenium IDE中使用用户扩展(视频) Sideflow用户扩展 (用于IDE中的while循环) You do not have to program anything. This can be done even in Selenium IDE (guess you are using it now) with ...
-
使用replicate()滚动100个骰子10,000次;(using replicate() to roll 100 dice 10,000 times; unexpected results)[2022-04-24]
猜测时,在计算z时设置n <- 100而不是n <- 10000 。 提供显式变量名称是个好主意,所以你不要混淆。 例如,您需要区分n_dice_rolls和n_replicates 。 顺便提一下,你计算100个骰子的平均值的代码是不正确的。 sample(1:6, n, replace=TRUE)滚动骰子; 你也不需要调用replicate() 。 我想你想要这样的东西。 roll_nd6 <- function(n_dice) { sample(1:6, n_dice, replace = TRU ... -
10,000以下的数字总和是Java中3,5或7的倍数(Sum of numbers under 10,000 that are multiples of 3, 5 or 7 in Java)[2023-07-01]
最简单的方法是使用for循环: int sum = 0; for(int i=1; i<10000; i++) { if (i % 3 == 0 || i % 5 == 0 || i % 7 == 0) sum += i; } The easiest approach would be to use a for loop thus: int sum = 0; for(int i=1; i<10000; i++) { if (i % 3 == 0 || i % 5 == 0 ... -
通过绘制预渲染图像(或预渲染的画布)来实现最佳帧速率。 您可以将代码重构为: 创建大约2-3个屏幕外(内存中)画布,每个画布上绘制1/3的粒子 为每个画布分配一个下降和一个漂移。 在每个动画帧中,将每个屏幕外画布(根据其自身的降低和漂移的偏移量)绘制到屏幕画布上。 结果应该是大约每秒60帧。 该技术用于增加内存使用量以实现最大帧速率。 以下是示例代码和演示: var canvas=document.getElementById("canvas"); var ctx=canv ...
-
行不会成为问题,但是,插入所述行的方式可能是。 如果插入时间是主要问题之一,那么请确保您可以批量插入它们或使用较少行的格式。 您可以以jsonb格式存储所有数据,特别是因为您不会对数据进行任何更新 - 将它们一次全部存储在一个表中可能会很方便,但性能可能会更低。 在任何情况下,由于您没有更新数据,因此(通常是默认的)fillfactor为100是合适的。 我不会使用“多列”方法,因为您所谈论的数据量确实不是那么多。 使用2个表和几列的第一个示例很可能是获得结果的最佳方式。 索引以下列可能很有用:analys ...
-
MikeD对你的危险FindResults()调用是正确的。 但是,有一种更好的方法可以检查结果。 “FindResults集合”不是纯粹的集合,而是包含一个名为“ResultsQuality”的额外属性。 文档在这里: http://msdn.microsoft.com/en-us/library/aa493061.aspx Resultsquality返回GeoFindResultsQuality枚举。 您想要检查值geoAllResultsGood和geFirstResultGood。 所有其他结果应 ...