if(qb==NULL || qa && qa->mi<qb->mi)
时间: 2023-11-07 18:34:46 浏览: 155
I'm sorry, I am unable to answer that question. It does not seem to be a complete or coherent question. Can you please provide more context or clarity?
相关问题
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>小精灵转呀转~</title> <style> * { list-style: none; margin: 0; padding: 0; } .box2 { width: 260px; height: 190px; margin: 100px auto; /* background-color: skyblue; */ } .box2 li { float: left; width: 24px; height: 24px; background-color: pink; margin: 10px 0 30px 30px; background: url(qb.png) no-repeat; } </style> </head> <body> <div class="box2"> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </div> <script> var change = document.querySelectorAll('li'); for (var i = 0; i < change.length; i++) { var index = i * 44; change[i].style.backgroundPosition = '0 -' + index + 'px'; } </script> </body> </html>用其他方法实现这个效果,至少三种
这段 HTML + CSS + JavaScript 代码实现的效果是将一张包含了多个小图片的图片作为背景,然后通过 JavaScript 代码实现将每个小图片的位置进行调整,从而实现一个转盘的效果。
下面是三种用其他方法实现这个效果的方式:
1. 用 CSS3 动画实现转盘效果
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小精灵转呀转~</title>
<style>
* {
list-style: none;
margin: 0;
padding: 0;
}
.box2 {
width: 260px;
height: 190px;
margin: 100px auto;
position: relative;
}
.box2 ul {
position: absolute;
top: 0;
left: 0;
animation: rotate 5s linear infinite;
}
.box2 li {
width: 24px;
height: 24px;
background-color: pink;
background: url(qb.png) no-repeat;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="box2">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</body>
</html>
```
2. 用 Canvas 实现转盘效果
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小精灵转呀转~</title>
<style>
* {
list-style: none;
margin: 0;
padding: 0;
}
.box2 {
width: 260px;
height: 190px;
margin: 100px auto;
position: relative;
}
.box2 canvas {
position: absolute;
top: 0;
left: 0;
}
</style>
</head>
<body>
<div class="box2">
<canvas id="canvas" width="260" height="190"></canvas>
</div>
<script>
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var img = new Image();
img.src = 'qb.png';
img.onload = function() {
var count = 0;
setInterval(function() {
count += 44;
if (count >= 528) {
count = 0;
}
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(img, 0, count, 24, 24, 118, 82, 24, 24);
}, 100);
}
</script>
</body>
</html>
```
3. 用 SVG 实现转盘效果
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小精灵转呀转~</title>
<style>
* {
list-style: none;
margin: 0;
padding: 0;
}
.box2 {
width: 260px;
height: 190px;
margin: 100px auto;
position: relative;
}
.box2 svg {
position: absolute;
top: 0;
left: 0;
transform-origin: 50% 50%;
animation: rotate 5s linear infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="box2">
<svg viewBox="0 0 24 528" width="24" height="528">
<use xlink:href="#icon"></use>
</svg>
<svg style="display: none;">
<symbol id="icon">
<image href="qb.png" width="24" height="528"></image>
</symbol>
</svg>
</div>
</body>
</html>
```
<template> <div class="box"> <el-container> <el-header class="tou"> <myhead></myhead> </el-header> <el-container> <el-aside class="zuo"> <myleft></myleft> </el-aside> <el-container> <el-main class="you"> <router-view></router-view> </el-main> </el-container> </el-container> </el-container> </div> </template> <script scoped > import myhead from "../components/myhead.vue" import myleft from "../components/myleft.vue" export default { components: { myhead, myleft, } } </script> <style> .box { height: calc(100vh - 60px); width: 100vw; display: flex; min-width: 700px; overflow-y: hidden; } body { overflow-x: hidden; margin-left: 0px; margin-top: 0px; } .tou { height: 50px; background-color: rgb(0, 0, 0); } .zuo { width: 200px; height: 100%; overflow-y: scroll; } .you { flex: 9; height: 100%; background: #f9ffb9; position: fixed; width: 100%; float: left; margin-left: -100px; } </style> zuo的滚动条拉不动
抱歉,我的建议有误。你的代码中,`.zuo` 元素的高度已经被正确计算,可以出现滚动条。但是,你在 `.you` 元素中设置了 `position: fixed;` 样式,导致它脱离了普通文档流,覆盖在了 `.zuo` 元素上方,导致无法操作 `.zuo` 元素的滚动条。
你可以尝试把 `.you` 元素的 `position` 属性改为 `absolute`,并且在 `.qb` 元素上添加 `position: relative;` 样式,这样就可以让 `.you` 元素相对于 `.qb` 元素定位,不会遮盖 `.zuo` 元素了。
阅读全文