首页 \ 问答 \ Bootstrap中的Bootstrap单选按钮没有样式不可更改(Bootstrap radio button in bootstrap without styling not changable)

Bootstrap中的Bootstrap单选按钮没有样式不可更改(Bootstrap radio button in bootstrap without styling not changable)

我有一个带有2个单选按钮的html页面('on'和'off',其中'off'是默认值),没有任何样式。 如果我不包括bootstrap javascript,这工作正常。 一旦我将它包含在头部,单选按钮就不再起作用了。 我无法将其从“关闭”更改为“打开”。 我不想设置这个样式,因为我的用户习惯于单选按钮是圆圈:-(

马塞尔

<html>
<head>
<script type="text/javascript" src="/scripts/jquery.js">
<script type="text/javascript" src="/scripts/bs.js">
</head>
<body>
....
<form id="config" method="post">
....
<input type="radio" name="DHCP" id="DHCP_OFF" value="DHCP_OFF" checked>off
<input type="radio" name="DHCP" id="DHCP_ON" value="DHCP_ON">on
....
</form>
....
</body>
</html>

I have an html page with 2 radio buttons ('on' and 'off' where 'off' is the default) that has no styling whatsoever. This works fine if I'm not including bootstrap javascript. As soon as I include it in the head, the radio-button doesn't work anymore. I can not change it from 'off' to 'on'. I do not want to style this one because my users are accustomed to the radio buttons being circles :-(

Marcel

<html>
<head>
<script type="text/javascript" src="/scripts/jquery.js">
<script type="text/javascript" src="/scripts/bs.js">
</head>
<body>
....
<form id="config" method="post">
....
<input type="radio" name="DHCP" id="DHCP_OFF" value="DHCP_OFF" checked>off
<input type="radio" name="DHCP" id="DHCP_ON" value="DHCP_ON">on
....
</form>
....
</body>
</html>

原文:https://stackoverflow.com/questions/18974624
更新时间:2022-03-14 21:03

最满意答案

你可以用groupby来做到这一点

In [60]: from itertools import groupby
In [61]: ar = [2,2,2,1,1,2,2,3,3,3,3]
In [62]: print [(k, sum(1 for i in g)) for k,g in groupby(ar)]
[(2, 3), (1, 2), (2, 2), (3, 4)]

You can do this with groupby

In [60]: from itertools import groupby
In [61]: ar = [2,2,2,1,1,2,2,3,3,3,3]
In [62]: print [(k, sum(1 for i in g)) for k,g in groupby(ar)]
[(2, 3), (1, 2), (2, 2), (3, 4)]

相关问答

更多
  • 你在正确的轨道上。 问题在于,你不能只是在这里增量地构建结果列表 - 你必须从递归调用中得到的列表中删除头部,并检查是否需要添加新对或增加最后一个的计数一: def func[X](xs: List[X]): List[(Int, X)] = xs match { case Nil => Nil case y :: ys => func(ys) match { case (c, `y`) :: rest => (c + 1, y) :: rest case r ...
  • 要使用group函数,您需要承诺您将传递一个==可用的项目列表,也就是说, Eq类型类的成员。 如果你省略了类型,或者你指定了一个属于Eq成员的类型,它将起作用; 如果你想变得更一般,你需要承诺你正在使用Eq东西: encode :: Eq a => [a] -> [(Int,a)] encode = map (\ws -> (length ws, head ws)) . group (实际上,这是通过将Eq的实现作为隐藏参数传递的,因此group会知道使用哪个(==) ;与函数参数的相似性是故意的。) ...
  • 尝试如果这样的事情有效 def rle_encode(image): """ receives a masked image and encodes it to RLE :param mask_image: :return: string corresponding to the rle of the input image """ pixels = image.flatten() # We avoid issues with '1' at the s ...
  • 我目前只是遍历数组,并返回一个列表,而不使用任何Repa函数。 我正在Boolean s而不是1和0,但算法是相同的。 之后我将这个列表转换为Repa阵列。 runLength :: Array U DIM1 Bool -> [Length] runLength arr = go ([], 0, False) 0 arr where Z :. n = extent arr go :: Accumulator -> Int -> Array U DIM1 Bool -> [Length] ...
  • 我发现了我的问题。 如果重复次数达到15,则会为列表添加额外的值。 为了防止这种情况,我将代码更改为此。 for pixel in imagePixels: if count >= 15: encodedImage.append(15) encodedImage.append(prev) #changed line tempmap += "1" tempmap += "0" count = 0 p ...
  • 我会假设你的问题是以JPEG格式编码的AC块系数中的RLE。 JPEG中使用的RLE变体非常具体。 每个8×8像素块用DCT变换并量化。 然后,对于第一DC系数和63 AC系数,DCT输出(64个系数)被分离。 使用Zig-Zag模式将8x8 AC coefs块转换为线性阵列,然后进行RLE编码 ZigZag通常与RLE运行结合使用,所以我们拥有非线性内存访问的RLE,并且应该优化这两种功能。 警告! JPEG中的RLE仅用于零元素!,请查看ISO / IEC 10918-1:1993标准的F.1.2.2. ...
  • 你可以用groupby来做到这一点 In [60]: from itertools import groupby In [61]: ar = [2,2,2,1,1,2,2,3,3,3,3] In [62]: print [(k, sum(1 for i in g)) for k,g in groupby(ar)] [(2, 3), (1, 2), (2, 2), (3, 4)] You can do this with groupby In [60]: from itertools import grou ...
  • 您需要一个辅助函数,该函数具有计数作为附加参数。 你检查前两个元素是否互相反复,如果是匹配则增加其余元素的数量,或者通过在递归调用中进行匹配并将count重置为1来递归。 这是一个草图,你需要实现部分: (define (encode lst) (define (helper lst count) (cond ((null? lst) ) ((null? (cdr lst)) )) ((equal? (car lst) (cadr ...
  • 你可以使用itertools.groupby() : from itertools import groupby grouped = [list(g) for k, g in groupby(string)] 这将生成您的每个字母组作为列表列表。 您可以一步将其转换为RLE: rle = ''.join(['{}{}'.format(k, sum(1 for _ in g)) for k, g in groupby(string)]) 每个k是被分组的字母,每个g是一个迭代器,产生相同字母的N倍; s ...
  • 试试这个: DECLARE @MyTable TABLE ( Id INT, Value1 VARCHAR(10), Value2 VARCHAR(10), Value3 VARCHAR(10), DataDate DATE ); INSERT @MyTable SELECT 01, '1', ' 2', '3', '2000-01-01' UNION ALL SELECT 01, '1', ' 2', '3', '2000-01-02' UNION ALL ...

相关文章

更多

最新问答

更多
  • 您如何使用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)