我不知道该如何在Google上搜索,因此我想在这里询问。 由于我使用的节点包中的限制,我需要我的代码来检测输入的数字是否大于100,并将其分成较小的数字(不大于100)。因此,例如,如果输入的数字是264 ,它将分为3个数字:100、100和64。有没有办法解决?如果是这样,请告知。谢谢。
答案 0 :(得分:0)
我认为您可以重复减去该因数,直到您的数字小于该因数:
/*display bars menu and hide the menu*/
@media screen and (max-width: 1464px)
{
.navbar a:not(.resImg)
{
display: none;
}
.navbar a.icon
{
float: right;
display: block;
margin-right: 8px;
}
.logoImg
{
width: 100%;
float: none;
}
.logoImg img
{
padding: 6px !important;
}
div.mainMenu
{
padding: 0 !important; /*removes the extra padding when the menu is closed*/
width: 100%;
text-align: center;
}
}
/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon.*/
@media screen and (max-width:1464px)
{
.navbar.responsive {position: relative;}
.navbar.responsive a.icon
{
position: inherit;
right: 0;
top: 0;
}
.navbar.responsive .mainMenu a
{
float:none;
display: block;
text-align: center;
}
}
/*CSS for the navbar*/
nav.navbar
{
width: 95%;
margin: auto;
background-color: #595959;
font-size: 1.2em;
overflow: auto;
}
/*div for the img logo and bars menu*/
.logoImg
{
float: left;
display: inline;
background-color: #4e4e4e;
}
/*logo img*/
.resImg img
{
padding: 9px 7px 7px 7px;
position: fixed;
}
.resImg img:hover
{
background-color: indianred;
cursor: pointer;
}
/*css for bars icon*/
.icon
{
display: none;
color: white;
text-decoration: none;
font-size: 23px;
padding: 19px 15px;
margin: 4px 0;
}
.icon:hover
{
background-color: indianred;
}
/*list of main menu*/
div.mainMenu
{
float: left;
padding: 30px 2px;
text-align: center;
display: inline;
padding-left: 13%;
}
div.mainMenu a
{
color: white;
text-decoration: none;
padding: 25px 5px;
}
div.mainMenu a:hover
{
background-color: indianred;
}