我试图在输入类型中获得正则表达式模式number以仅显示数字和点.我试过这样的事.
<input type="number" pattern="[0-9.]*">
<input type="tel">
Run Code Online (Sandbox Code Playgroud)
两者都只显示数字(0-9),但不显示.(点).我需要在输入字段中使用点.
是否有可能通过html5?或者我要用javascript去?
注意:这在Android中运行良好,但是.(点)不在iphone中显示
我需要显示这样的移动键盘..

对此有何帮助?
<a href="sample.pdf" target="_blank">Download</a>
Run Code Online (Sandbox Code Playgroud)
如果单击"下载"按钮,则此目标空白将打开一个新窗口.
但我需要它来提示保存此文件的对话框.我怎样才能做到这一点?

这是我的媒体查询:
@media screen and (min-device-width: 768px) and (max-device-width: 1824px) and (orientation : portrait){
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important ;
}
.visible-tablet {
display: inherit !important;
}
.hidden-tablet {
display: none !important;
}
}
@media screen and (min-device-width: 768px) and (max-device-width: 1824px) and (orientation : landscape){
.hidden-desktop {
display: inherit !important;
}
.visible-desktop {
display: none !important ;
}
.visible-tablet {
display: inherit !important;
}
.hidden-tablet {
display: none !important;
}
}
@media screen and …Run Code Online (Sandbox Code Playgroud) 我有一个数字类型的输入字段
<input type="number" pattern="[0-9]*"/>
Run Code Online (Sandbox Code Playgroud)
在普通的浏览器中,我正在键入一些数字而我正在点击屏幕,它隐藏了iphone/ipad键盘.
但如果它在iframe内部,则无效.我们需要明确点击完成按钮.此问题仅适用于iphone/ipad
这是一个iframe问题.任何使用Javascript/Jquery的修复都将受到高度赞赏.
更新
试着
document.activeElement.blur();
Run Code Online (Sandbox Code Playgroud)
在javascript中触发事件时聚焦.他们都没有工作..
$(document).on('focusin', function(){
$('input').css("background-color", "green");
console.log('focusin!')
});
$(document).on('focusout', function(){
console.log('focusout!')
$('input').css("background-color", "yellow");
$('input').blur();
});
Run Code Online (Sandbox Code Playgroud)
focusout不是在iframe内部调用!
我的问题是 **How to force close ipad/iphone keypad when input element is not focused using Javascript/Jquery?**
答案将按照规定予以奖励!
我试图将div设为选中而不是悬停.
我需要在选择div时更改轮廓颜色.我试过和悬停一样.但我需要帮助选择器.可以通过JavaScript或CSS 3就足够了吗?
这是我尝试过的:
div {
background: #ccc;
margin: 20px;
}
div:hover {
outline: 1px solid blue;
}Run Code Online (Sandbox Code Playgroud)
<div>1</div>
<div>2</div>
<div>3</div>Run Code Online (Sandbox Code Playgroud)
我正在使用iframe来使用angularjs和离子框架显示内容.在这里,我需要给窗口高度作为iframe高度,所以我用过
$scope.iframeHeight = window.innerHeight;
Run Code Online (Sandbox Code Playgroud)
但是,我只获得1/4屏幕.
这是我到目前为止尝试过的.
的index.html
<!DOCTYPE html>
<html ng-app="ionicApp">
<head>
<!-- ionic/angularjs CSS -->
<link href="css/ionic.css" rel="stylesheet">
<link href="css/ionic-custom.css" rel="stylesheet">
<!-- ionic/angularjs js bundle -->
<script type="text/javascript" src="js/ionic.bundle.js"></script>
<script>
angular.module('ionicApp', ['ionic'])
.controller('MainCtrl', function($scope) {
$scope.iframeHeight = window.innerHeight;
});
</script>
</head>
<body ng-controller="MainCtrl">
<iframe src="http://stackoverflow.com" ng-style="{height:iFrameHeight}" id="iframeid" width="100%" ></iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
我正在使用离子框架来开发本机应用程序.在这里,我在所有页面中都有默认标题.切换到第二页时,我需要应用内浏览器来查看外部内容.
所以,我使用了window.open
<a href="#" onclick="window.open('https://google.com','_blank','location=yes','closebuttoncaption=Return');">Click Here to view inapp browser</a>
Run Code Online (Sandbox Code Playgroud)
但是,当我在应用程序内浏览器中查看内容时,我需要标题保持不变.
在离子骨架中有可能吗?我不需要iframe.它在html中很重.
更新:
我有一个html文件,我注入iframe.喜欢
<div id="header"></div>
<iframe src="serveraddress/index.html"></iframe>
Run Code Online (Sandbox Code Playgroud)
而不是iframe,还有什么东西仍然保持标头不变?如果我使用应用内浏览器,我的标题是不可见的.
在这里,我使用正则表达式模式来掩盖信用卡号码的最后4位数字
$('#ccnumber').html(ccnbr); //ccnumber refers to div ID
$('#ccnumber').text(function(_,val) {
return val.replace(/\d{12}(\d{4})/, "************$1");
});
Run Code Online (Sandbox Code Playgroud)
它仅适用于16位数的信用卡号码.但是,我需要屏蔽输入的数字(可能是10或11)*并显示最后4位数字.在javascript/Jquery中有可能吗?
我有一些专栏有四个字,即预交易跟进,交易后跟进,其中一些有三个字.我尝试了下面的css将文本换行到多行.
::ng-deep .ag-theme-material .ag-header-cell-label .ag-header-cell-text{
white-space: normal;
overflow-wrap: break-word;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<ag-grid-angular class="ag-theme-material" [rowData]="rowData" [columnDefs]="columnDefs" [overlayLoadingTemplate]="overlayLoadingTemplate" [domLayout]="domLayout" [enableSorting]="true" (gridReady)="onGridReady($event)" (gridOptions)="gridOptions" >
</ag-grid-angular>
Run Code Online (Sandbox Code Playgroud)
但列标题保持不变.我想将列标题文本包装成多行.反正有没有这样做?
注意:我可以使用包装内容cellStyle: {'white-space': 'normal'}
{headerName: 'headername', field: 'headerfield', autoHeight:true, width: 100, cellStyle: {'white-space': 'normal'}},
Run Code Online (Sandbox Code Playgroud)
但我想包装标题.
这个问题可能与常见问题类似,但是这个问题有一些不同的方法。
在我的angular 7应用程序中,我有以下5个数组,需要使用基于id的动态键将其转换为以下单个对象。
{
"enabled-41": true,
"enabled-42": true,
"enabled-43": true,
"enabled-44": true,
"enabled-45": false,
"abc-41": "some description 1",
"abc-42": "some description 12",
"abc-43": "some description 123",
"abc-44": "some description 1234",
"abc-45": null,
"def-41": "some description 2",
"def-42": "some description 23",
"def-43": "some description 234",
"def-44": "some description 2345",
"def-45": null,
"type-41": "def",
"type-42": "abc",
"type-43": "def",
"type-44": "abc",
"type-45": null,
"weight-41": "25",
"weight-42": "25",
"weight-43": "25",
"weight-44": "25",
"weight-45": null
}
Run Code Online (Sandbox Code Playgroud)
{
"enabled-41": true,
"enabled-42": true,
"enabled-43": true,
"enabled-44": true, …Run Code Online (Sandbox Code Playgroud)javascript ×7
html ×6
css ×3
angularjs ×2
iframe ×2
ios ×2
jquery ×2
ag-grid ×1
angular ×1
arrays ×1
css3 ×1
ecmascript-6 ×1
html5 ×1
inappbrowser ×1
iphone ×1
numpad ×1
object ×1
regex ×1
typescript ×1