发生错误时,我需要删除一个复选框的"已检查"属性.
.removeAttr函数不起作用.任何的想法?:/
HTML
<div data-role="controlgroup" data-type="horizontal" data-mini="true" style="margin-left: auto; margin-right: auto; width: 100%; text-align: center;">
<input type="checkbox" id="captureImage" name="add_image" class="custom" />
<label for="captureImage" data-icon="checkbox">Image</label>
<input type="checkbox" id="captureAudio" name="add_audio" class="custom" />
<label for="captureAudio" data-icon="checkbox">Audio</label>
<input type="checkbox" id="captureVideo" name="add_video" class="custom" />
<label for="captureVideo" data-icon="checkbox">Video</label>
</div>
Run Code Online (Sandbox Code Playgroud)
使用Javascript
$("#captureImage").live("change", function() {
// $("#captureImage").prop('checked', false); // Here Work
if($("#captureImage:checked").val() !== undefined) {
navigator.device.capture.captureImage(function(mediaFiles) {
console.log("works");
}, function(exception) {
$("#captureImage").prop('checked', false); // Not Works Here
_callback.error(exception);
}, {limit: 1});
}
});
/*
$("#captureAudio").live("change", function() {
if($("#captureAudio:checked").val() …Run Code Online (Sandbox Code Playgroud) 我很难使用CSS在屏幕上集中我的组件。
看我的App.js:
import { Container } from 'native-base';
import React from 'react';
import { StyleSheet } from 'react-native';
import Screen from './ScreenContainer';
const styles = StyleSheet.create({
container: {
backgroundColor: '#FF6666',
flex: 1
}
});
const App = () => (
<Provider store={store}>
<Container style={styles.container}>
<Screen />
</Container>
</Provider>
);
export default App;
Run Code Online (Sandbox Code Playgroud)
现在,看看我的 ScreenContainer.js
import { Container, Content, Form, Input, Label, Item } from 'native-base';
import React from 'react';
import AppLogo from '../components/AppLogo';
const Screen = () => …Run Code Online (Sandbox Code Playgroud) 我有一个关于 onLayout 事件的问题
代码
<View>
<Text>
<Text onLayout={e => {console.log("this isn't triggered!")}}>{"foo"}</Text>
</Text>
</View>
Run Code Online (Sandbox Code Playgroud)
B代码
<View>
<Text onLayout={e => {console.log("here the event it is called, but I need call in a SubText")}}>{"foo"}</Text>
</View>
Run Code Online (Sandbox Code Playgroud) 我有这个问题:
我需要在第一行中加上"dummy"这个词,直到该行完成.
您可以在此处查看示例:https://snack.expo.io/B1KcRgGWX
代码:
import React, { Component } from 'react';
import { Text, View, StyleSheet } from 'react-native';
import { Constants } from 'expo';
export default class App extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.paragraphs}>
<Text style={styles.textParagraph}>Lorem Ipsum is</Text>
<Text style={styles.emptyTerm} />
<Text style={styles.textParagraph}>dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of …Run Code Online (Sandbox Code Playgroud) 我有以下元素:
<ul id="towns">
<li class="clearfix odd 516_499_132_0_0 town132">...</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我需要为一个参数提取类"town132",但是数字 - 例如132 - 是可变的.
我如何提取?
$('#towns').children('li').each(function() {
parameter = $(this). // ???
});
Run Code Online (Sandbox Code Playgroud) 存在某种方法可以做这样的事情吗?
const styles = StyleSheet.create({
content: {
alignItems: 'center',
flex: 1,
justifyContent: 'center'
},
mainColor: { color: '#FFFFFF' },
usernameIcon: {
{this.styles.mainColor} // <-- How import the style, instead does write the code - color: '#FFFFFF'?
},
usernameItem: {
backgroundColor: '#FF8484',
borderColor: '#FFFFFF',
paddingTop: 7
},
});
Run Code Online (Sandbox Code Playgroud)
在我的组件中添加许多类,这非常冗长,我可能会做类似上面代码的事情。
react-native ×4
css ×2
javascript ×2
jquery ×2
cordova ×1
flexbox ×1
ios ×1
reactjs ×1
regex ×1
replace ×1
string ×1
stylesheet ×1