首页 \ 问答 \ coda slider 2.0具有%宽度以响应(coda slider 2.0 to have % widths for responsive)

coda slider 2.0具有%宽度以响应(coda slider 2.0 to have % widths for responsive)

我已经使用了Nail Doherty的coda滑块几年了,并且想知道是否有人知道如何使其响应,以便它使用容器的%宽度而不是px。 我知道在css中需要一个固定的宽度来计算面板的js中的宽度,以使滑块正确工作/显示,但是想知道是否有修复使其变为液体。

我可以使用媒体屏幕查询来重新调整某些屏幕分辨率的大小,但如果可能的话,我会在流畅的答案之后。


I have used Nail Doherty's coda slider for a few years now and was wondering if anyone knew of a way to make it responsive so that it uses % widths for the container not px. I understand that it needs a fixed width in the css to calculate the widths in the js for the panels to make the slider work/display correctly but wondered if there was a fix to make it liquid.

I can use media screen queries for it to re-size at certain screen resolutions but was after a liquid answer if possible.


原文:https://stackoverflow.com/questions/11029925
更新时间:2023-04-18 21:04

最满意答案

浮点数中的尾数通常用大于或等于1但小于2的数字表示。在所有示例中,它恰好等于1,但最后一个。

那么,你最后一个怎么办? 将0.857421875重新表示为0.857421875 * 2/2,即1.71484375 * 2 -1 。 现在,你想要十六进制的尾数。 Double在尾数中具有53位(包括隐含的1),因此在这些52(53)位中的1.71484375实际上表示为等于1.71484375 * 2 52 = 7722969673498624 = 0x1B700000000000的整数。 所以,你有它,0x1.b7p-1。


The mantissa in the floating point number is typically represented with a number bigger or equal than 1 but smaller than 2. It's exactly equal to 1 in all examples but the last one.

So, what do you do with the last one? Rerepresent 0.857421875 as 0.857421875 * 2/2, that is, as 1.71484375*2-1. Now, you want the mantissa in hex. Double has 53 bits in the mantissa (including the implied 1.), so 1.71484375 in those 52(53) bits is effectively represented as an integer equal to 1.71484375*252 = 7722969673498624 = 0x1B700000000000. So, there you have it, 0x1.b7p-1.

相关问答

更多
  • 0x1e3和0x1e3d是十六进制整数文字。 请注意,在这种情况下, e和d是十六进制数字,而不是指数指示符或double类型指示符。 1e3d是一个十进制浮点数字。 e是指数指标, d表示这是double而非float 。 符号0x1p3是以十六进制表示浮点文字的一种方式,正如您可以在Java语言规范的第3.10.2节中阅读的那样。 这意味着1次2的权力3; 指数是二元的(所以,它是2个电量而不是10个电量)。 0x1e3 and 0x1e3d are hexadecimal integer litera ...
  • 0x0.3p10是C99中引入的十六进制浮点文字的示例。 p将基数与指数分开。 0x0.3位称为有效部分(整数为可选分数),指数为两倍的幂。 该特定值以十六进制为0.3 ,或3 * 16 -1 ( 3/16 )乘以2 10 × 2 10 ( 1024 )计算,得到3 * 1024 / 16或192 。 以下程序确认: #include int main (void) { double d = 0x0.3p10; printf ("%.f\n", d); retur ...
  • 让我重新开始第三次。 我们试图加速 q = x / y 其中y是整数常数, q , x和y都是IEEE 754-2008 binary32浮点值。 下面, fmaf(a,b,c)表示使用binary32值的融合乘法加a * b + c 。 天真的算法是通过预先计算的倒数, C = 1.0f / y 所以在运行时一个(快得多)乘法就足够了: q = x * C Brisebarre-Muller-Raina加速度使用两个预先计算的常数, zh = 1.0f / y ...
  • 根据语法 : DecimalFloatingPointLiteral: Digits . [Digits] [ExponentPart] [FloatTypeSuffix] . Digits [ExponentPart] [FloatTypeSuffix] Digits ExponentPart [FloatTypeSuffix] Digits [ExponentPart] FloatTypeSuffix HexadecimalFloatingPointLiteral: HexS ...
  • 0x1. >>> (1.2).hex() '0x1.3333333333333p+0' >>> (1125.2).hex() '0x1.194cccccccccdp+10' >>> (7e85).hex() '0x1.204362b6da56fp+285' >>> (5e-3).hex() '0x1.47ae147ae147bp-8' >>> (-8.).hex() '-0x1.0000000000000p+3' >>> (60123.124).he ...
  • float_of_string应该能够解析它们: # float_of_string "0x1.199999999999Ap1";; - : float = 2.2 然而,正如Alain Frisch在OCaml的bug跟踪器中指出的那样 ,支持实际上取决于底层的libc,并且目前不会在MSVC端口上工作。 float_of_string should be able to parse them: # float_of_string "0x1.199999999999Ap1";; - : float = ...
  • 浮点数中的尾数通常用大于或等于1但小于2的数字表示。在所有示例中,它恰好等于1,但最后一个。 那么,你最后一个怎么办? 将0.857421875重新表示为0.857421875 * 2/2,即1.71484375 * 2 -1 。 现在,你想要十六进制的尾数。 Double在尾数中具有53位(包括隐含的1),因此在这些52(53)位中的1.71484375实际上表示为等于1.71484375 * 2 52 = 7722969673498624 = 0x1B700000000000的整数。 所以,你有它,0x ...
  • 您可以使用仅使用整数的这段代码 : printf(n==1?"1.00000":"0.%05d ", 100000/n); You can use this piece of code that uses only integers: printf(n==1?"1.00000":"0.%05d ", 100000/n);
  • 当前的计算机具有32位或64位寄存器,因此对字节进行计算效率非常低。 此外,计算机以二进制方式工作,因此使用2的幂的基础更有效。 像Mysticial说的那样,他们会使用2 32或2 64 。 每个计算机字将存储数字的数字,并且它们逐位工作。 在某些情况下,您不需要太多计算,但大多数情况下您输入并输出十进制字符。 使用功率或10的基础的这种情况更有效。 您可以在32位计算机中使用base 10 9 ,在64位计算机中使用10 19 ,因为这是您可以存储在32或64位值中的最大功率10 Current com ...
  • 默认情况下,Fortran的REAL数字常量是单精度的 ; 但是,在C中,浮点文字具有双精度。 当您将0.8804418转换为单精度然后在C中将其打印为double精度时,您将获得0.8804417849打印( 演示 ) float x = 0.8804418f; printf("%.10g\n", x); Fortran的打印输出似乎是四舍五入的相同数字。 Fortran的双精度REAL数字语法使用后缀d : print *, 0.8804418d+0 这打印0.88044180000000005 ( ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。