代码:
<div class="marquee">
<ul>
<li>
<a href="https://developer.apple.com/swift/"><img class="marquee-itm" src="Vendors/Images/Apple_Swift_Logo.png" /></a>
Run Code Online (Sandbox Code Playgroud)
情况:
当我删除<a>标签时,这有效:
.marquee ul li img {
max-height: 80%;
}
Run Code Online (Sandbox Code Playgroud)
问题:
添加 时<a>,我找不到设置图像样式的方法。
1) 不起作用。
.marquee ul li a img {
max-height: 80%;
}
Run Code Online (Sandbox Code Playgroud)
2)不起作用。
.marquee ul li a {
max-height: 80%;
}
Run Code Online (Sandbox Code Playgroud)
3)不起作用。
.marquee-items {
max-height: 80%;
}
Run Code Online (Sandbox Code Playgroud)
题:
我怎样才能让它与<a>标签一起工作来保持我的图片链接?
编辑:
只是想确保没有误解。我正在使用一个已经定义了宽度的轮播。旋转木马中有许多图像。我只需要定义图像的最大高度,这样它们就不会溢出。通过添加<a></a>标签制作可点击的图像后,我似乎无法选择它们。
还:
4) 不起作用。
.marquee ul li a{
display: inline-block;
max-height: 80%;
}
.marquee ul li a img {
max-height: …Run Code Online (Sandbox Code Playgroud) 问题:
0)用户是在 Firebase 的身份验证系统中创建的(我在“身份验证”选项卡中看到它),
1)但没有对数据库进行任何更改。
2)页面似乎无限加载。
3) 仅“Started 1...”记录到控制台。
代码:
router.post('/register', function(req, res, next) {
var username = req.body.username;
var email = req.body.email;
var password = req.body.password;
var password2 = req.body.password2;
// Validation
req.checkBody('username', 'Username is required').notEmpty();
req.checkBody('email', 'Email is required').notEmpty();
req.checkBody('email', 'Email is not valid').isEmail();
req.checkBody('password', 'Password is required').notEmpty();
req.checkBody('password2', 'Passwords do not match').equals(req.body.password);
var errors = req.validationErrors();
if(errors){
res.render('users/register', {
errors: errors
});
} else {
console.log("Started 1...");
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error, userData) {
console.log("Started 2...");
if(error){
var errorCode = …Run Code Online (Sandbox Code Playgroud) javascript node.js express firebase firebase-realtime-database
代码:
前端
$(document).ready(function(){
$('.delete-post').on('click', function(){
var id = $(this).data('id');
var section = $(this).data('section');
var url = '/users/delete/'+id;
if(confirm("Delete Post ?")){
$.ajax({
url: url,
type:'DELETE',
success: function(result){
console.log('Deleting post...');
window.location.href='/users/profile';
},
error: function(err){
console.log(err);
}
});
}
});
});
Run Code Online (Sandbox Code Playgroud)
后端:
router.delete('/delete/:id', function(req, res, next) {
var id = req.params.id;
var section = req.params.section;
var image = "";
var author = "";
var postRef = firebase.database().ref("posts/"+section+"/"+id);
var userRef = firebase.database().ref("users/posts/"+id);
var likesRef = firebase.database().ref("users/likes/"+id);
var hotRef = firebase.database().ref("hot/"+section+"/"+id);
postRef.once('value', function(snapshot){
image = …Run Code Online (Sandbox Code Playgroud) 错误:
core.es5.js?0445:1084 ERROR SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>
Run Code Online (Sandbox Code Playgroud)
情况:
我想要实现的是预先选择用户之前已经做出的选择并防止他投票两次。
代码:
组件.html
<article class="panel panel-default">
<div class="panel-body">
{{ poll.title }}
<br>
<br>
<form #form="ngForm">
<fieldset [disabled]="alreadyVotedFor(-1)">
{{ poll.counter1 }} votes <input type="radio" id="{{ poll.choice1 }}" name="my_radio" value="{{ poll.choice1 }}" (click)="onChoice1(form)" [checked]="alreadyVotedFor(1)"> {{ poll.choice1 }}
<br>
{{ poll.counter2 }} votes <input type="radio" id="{{ poll.choice2 }}" name="my_radio" value="{{ poll.choice2 }}" (click)="onChoice2(form)" [checked]="alreadyVotedFor(2)"> {{ poll.choice2 }}
</fieldset>
</form>
</div>
<footer class="panel-footer">
<div class="author">
{{ poll.username }} …Run Code Online (Sandbox Code Playgroud) 情况:
我希望在将鼠标悬停在图表上时获得的数字工具提示旁边添加一个百分比。我怎样才能做到这一点?例如,我想在%旁边添加一个标志83.33。
错误:
ERROR TypeError: Cannot read property '0' of undefined
at i.label (eval at <anonymous> (http://localhost:3000/js/app/bundle.js:1564:1), <anonymous>:37:63)
Run Code Online (Sandbox Code Playgroud)
代码:
// Pie
public pieChartLabels:string[] = [];
public pieChartData:number[] = [];
public pieChartType:string = 'pie';
public pieChartOptions:any = {};
ngOnInit() {
var result1 = parseFloat(((this.poll.counter1/(this.poll.counter2+this.poll.counter1))*100).toFixed(2));
var result2 = parseFloat(((this.poll.counter2/(this.poll.counter2+this.poll.counter1))*100).toFixed(2));
this.pieChartData = [result1, result2];
this.pieChartLabels = [this.poll.choice1, this.poll.choice2];
this.pieChartType = 'pie';
this.pieChartOptions = {
tooltips: {
callbacks: {
label: function (tooltipItems, data) {
return data.datasets[tooltipItems.datasetIndex].label + ': ' + …Run Code Online (Sandbox Code Playgroud)