我正在研究解决方案
我创建了一个基本的 html 横幅,我想在其中保持图像和文本动画同步。
基本上图像动画就像缩放标志大约 3 秒,同时标志是动画的我想要文字在打字效果上相同
我已经使用 css 和 javascript 创建了基本解决方案,但它不同步
var typewriter = function(txt) {
var container = document.getElementById('typewriter'),
speed = 28,
i = 0,
wordsObj = txt.split(" ")
container.textContent = "";
runAllWords();
function runAllWords() {
if (i < wordsObj.length) {
var a = (i == 0) ? i : i - 1;
setTimeout(function() {
showWord(wordsObj[i], 0)
}, wordsObj[a].length * speed);
}
}
function showWord(word, countWord) {
if (countWord < word.length) {
setTimeout(function() {
showLetter(word, countWord)
}, speed); …Run Code Online (Sandbox Code Playgroud)我正在做 WordPress 项目,我有一个困难,我想在博客文章中添加“Blog”slug
例如我当前的博客 slug 是这样的
http://www.abc.com/post
Run Code Online (Sandbox Code Playgroud)
我想让它像
http://www.abc.com/blog/post
Run Code Online (Sandbox Code Playgroud)
我不想创建自定义帖子类型,我需要使用现有的帖子类型
我尝试了很多解决方案,例如将永久链接更改为 blog/%postname%
一个解决方案对我有用
下面是我的代码
add_action( 'init', 'my_new_default_post_type', 1 );
function my_new_default_post_type() {
register_post_type( 'post', array(
'labels' => array(
'name_admin_bar' => _x( 'Post', 'add new on admin bar' ),
),
'public' => true,
'_builtin' => false,
'_edit_link' => 'post.php?post=%d',
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => array( 'slug' => 'blog' ),
'query_var' => false,
'with_front' => false,
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', …Run Code Online (Sandbox Code Playgroud) 我正在研究解决方案
每当用户单击与单击的行相关的展开数据时,我都会创建基本的树型表,它会根据行数据显示在它下面
我已经实现了扩展/折叠到 N 个嵌套级别的基本功能。
但我只遇到一个问题,所以基本上所有行都有基于具有多个值的数组的条件扩展按钮
假设它是分割数组,有 3 个条目县、市、州
默认加载的数据将从 api 获取,现在我必须检查数组是否有任何可用的拆分!如果是,那么我使展开按钮可见
考虑这个场景
const split = ["country","city","state"]
Run Code Online (Sandbox Code Playgroud)
这是 Ui 的样子
+ Data_1
+ Data_2
Run Code Online (Sandbox Code Playgroud)
单击按钮 + 新数据表行将根据下一个可用拆分呈现,在我们的情况下是国家,因此视觉表示将类似于
- Data_1
Country_1
Country_2
+ Data_2
Run Code Online (Sandbox Code Playgroud)
这里国家没有展开按钮,因为用户还没有添加下一个拆分,让我们添加城市,并假设用户点击了 Country_1 所以数据会像
- Data_1
- Country_1
City_1
City_2
+ Country_2
+ Data_2
Run Code Online (Sandbox Code Playgroud)
我的解决方案在此级别之前工作正常,现在可以说用户已从拆分中删除国家/地区,应删除国家/地区和城市的所有节点,并且 - data_1 的图标应更改为 +
这是我的代码
import React, {useState, useEffect, useRef, Fragment} from "react";
import _ from "lodash";
import axios from "axios";
class TableRowData extends React.Component {
state = {
showIcon: false,
selection: [], …Run Code Online (Sandbox Code Playgroud) 我正在研究高级报告类型的解决方案。
所以基本上我已经使用 ngFor 循环创建了表,其中我编写了一些条件,使用户能够根据展开和折叠检查单击元素的详细信息
问题是这个条件执行无限时间,我想要的是这些条件应该只执行一次检查。无限地检查条件会导致 UI 性能下降。
这是我的代码
<div class="row" style="position:relative; overflow: hidden; margin-bottom: 30px;" >
<div class="tg-wrap">
<div class="zui-scroller">
<div class="tg">
<div class="report-row-header ">
<div class="tg-kiyi sticky-col-1" >#</div>
<div class="tg-kiyi" *ngIf="checkColumnVisibiliy('impressions') === true">Impressions</div>
<div class="tg-kiyi" *ngIf="checkColumnVisibiliy('conversions') === true">Conversion</div>
<div class="tg-kiyi " *ngIf="checkColumnVisibiliy('bids') === true">Bids</div>
<div class="tg-kiyi " *ngIf="checkColumnVisibiliy('wins') === true">Wins</div>
<div class="tg-kiyi" *ngIf="checkColumnVisibiliy('spend') === true">Spend</div>
<div class="tg-kiyi" *ngIf="checkColumnVisibiliy('ecpa') === true">eCPA</div>
<div class="tg-kiyi" *ngIf="checkColumnVisibiliy('ecpm') === true">eCPM</div>
<div class="tg-kiyi" *ngIf="checkColumnVisibiliy('winrate') === true">Win Rate</div>
<div class="tg-kiyi" *ngIf="checkColumnVisibiliy('clearrate') === true">Clear Rate</div>
<div class="tg-kiyi" …Run Code Online (Sandbox Code Playgroud) javascript ×2
angular ×1
arrays ×1
css ×1
html ×1
php ×1
react-native ×1
reactjs ×1
typescript ×1
wordpress ×1