jquery 根据值更改字体大小?
我有 html:
<div class="arrow-inner arrow-first arrow-border">
CAREER <strong>1.000</strong>
</div>
Jquery:
function battingAve1000(){
var maxBatAve = "1.000";
var batAve = $(".arrow-first strong").html();
if(maxBatAve == batAve)
$(".arrow-first strong").css('font-size', 20);
}
但它似乎不起作用?不知道为什么,似乎是对的......
I have html:
<div class="arrow-inner arrow-first arrow-border">
CAREER <strong>1.000</strong>
</div>
Jquery:
function battingAve1000(){
var maxBatAve = "1.000";
var batAve = $(".arrow-first strong").html();
if(maxBatAve == batAve)
$(".arrow-first strong").css('font-size', 20);
}
But it doesn't seem to work? Not sure why, seems right...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这会起作用
但是可以检查 firefox 的 firebug 并了解 console.log() 以查看您的变量返回的内容。
实际上你的代码确实有效,你只是没有调用该函数?请参阅此http://jsfiddle.net/FWPd2/
This will work
But yes check out firebug for firefox and learn about console.log() to see what your vars are returning.
Actually your code does work, you just didn't call the function perhaps? See this http://jsfiddle.net/FWPd2/