我们如何使用AngularJs动态地向表单添加文本框元素.例如,在这种情况下,我有一个文本和文本框,我想通过使用AngularJs单击按钮来添加该对的另一个.
<div ng-app>
<div ng-controller="ClickToEditCtrl">
<div ng-hide="editorEnabled" ng-click="editorEnabled=true">
{{title}}
</div>
<div ng-show="editorEnabled">
<input ng-model="title">
<button href="#" ng-click="editorEnabled=false">Done editing</button>
</div>
</div>
</div>
<div>
<input type="text" placeholder="Enter answer">
</div>
Run Code Online (Sandbox Code Playgroud) 如何在我的网站中使用维基百科的外观?有没有像 HTML 模板这样的准备好的模板,我可以稍作改动或以任何其他方式使用它?
我想通过单击箭头键在运行时动态调整我的地图大小.我的布局是:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MapActivity" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />
Run Code Online (Sandbox Code Playgroud)
我想我必须使用MapView和setLayoutParams,但我不确定如何.有人可以帮我怎样做吗?提前致谢.
我的代码是:
$(function(){
$('input:checkbox').on('change','span',function(){
var input= $(this).find('span');
if($(this).is(':checked')){
//alert($(this).name);
$(input).css('textDecoration','line-through');
}else{
$(input).css('textDecoration','none');
}
})
})
Run Code Online (Sandbox Code Playgroud)
这是我的HTML
<div><input type="checkbox" id="a1"></input><span>This is ok</span></div><br/>
<div><input type="checkbox" id="a2" ></input><span>This is yes</span></div>
Run Code Online (Sandbox Code Playgroud)
但它没有用.我想我没有得到正确的输入.提前致谢.