简体   繁体   English

在simpleweather.js中将大写更改为小写

[英]Changing uppercase to lowercase in simpleweather.js

This is very nitpicky of me but I want to change the upper case letters of current weather status to lower case. 这对我很挑剔,但我想将当前天气状况的大写字母更改为小写。 Mostly Cloudy to mostly cloudy. 大部分多云至大部分多云。 Also how would I style the text? 另外,我将如何设置文字样式? I've never used html in jquery before. 我以前从未在jQuery中使用过html。

html = '<span> It is currently ' + weather.currently + ' and </span>';

http://codepen.io/anon/pen/eNwzJp http://codepen.io/anon/pen/eNwzJp

http://simpleweatherjs.com/ http://simpleweatherjs.com/

Just use 只需使用

weather.currently.toLowerCase() weather.currently.toLowerCase()

For style you can add the class to your span tag 对于样式,您可以将类添加到span标签

<span class="sample">

and provide style details in css - 并在CSS中提供样式详细信息-

.sample {
  font-weight: bold;
}

There's a javascript method toLowerCase() and toUpperCase() to solve your problem. 有一个javascript方法toLowerCase()和toUpperCase()解决您的问题。 Reference is here . 参考在这里

So do: 这样:

weather.currently.toLowerCase()

For the styling you can check this site 对于样式,您可以检查此网站

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM