作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当元素在屏幕上时,我试图加宽一个 div(模拟进程栏)。我不能让任何事情发生。我究竟做错了什么?我正在尝试使用:
jQuery
$(document).ready(function() {
$(window).scroll(function() {
if ($('.progressFull').isOnScreen() == true) {
$(this).animate({
'width': '1000%'
}, 2000);
}
});
});
html
<div class="skillsCol">
<ul>
<li><a class="skill">C++</a>
<div class="progress"></div>
<div class="progressFull"></div>
</li>
</ul>
</div>
CSS
#
skills {
background - color: white;
}
.skillsCol li {
list - style - type: none;
}
.skillsCol {
width: 45 % ;
}
.progress {
width: 25 % ;
height: 2 % ;
margin - left: 50 % ;
margin - top: -5.4 % ;
border: 1px solid black;
z - index: 1;
}
.progressFull {
background: #7688A9;
width: 0%;
height: 2%;
margin-left: 50%;
margin-top: -4.1%;
z-index: 5;
}
最佳答案
this
指的是那里的窗口对象,您可能想指的是 .progress
或 .progressFull
元素。
$('.progressFull').animate({ 'width' : '1000%' }, 2000);
关于javascript - 用 jQuery 填充进度条(加宽 div),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29999422/
我正在研究 Java Se 7 OCA,无法弄清楚为什么下面的代码无法编译。主方法中的方法调用会给出编译错误,指出方法不明确。在此重载方法示例中,加宽和装箱之间的优先级规则似乎发生冲突。 public
如有错误,请指正。Boxing+Varargs 是否优于 Boxing+Widening? 我在site中找到了那是另一种方式。 最佳答案 当多个可以符合条件时调用什么方法在 JLS #15.2.2
当元素在屏幕上时,我试图加宽一个 div(模拟进程栏)。我不能让任何事情发生。我究竟做错了什么?我正在尝试使用: jQuery $(document).ready(function() {
我正在尝试使用自定义样式表更改垂直 QScrollBar 的宽度 QScrollBar:vertical { border: 2px solid grey; background:
我遇到了 https://code.google.com/p/hamcrest/issues/detail?id=130为 Hamcrest 匹配器添加一些语法糖。但这个想法被 Hamcrest 开发
我是一名优秀的程序员,十分优秀!