- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在制作我的自定义主页,我想将一个元素转换为另一个元素。
这是我的 HTML 代码:
<div id="index-features">
<ul>
<li>
<h5 id="feature-1" class="feature-title">Instant access</h5>
<span id="feature-1-description" class="feature-description">After purchasing a style, there will be no waiting. Your account will be directly promoted in the "Customers" group and you will unlock access to all the features of the forum.</span>
</li>
<li>
<h5 id="feature-2" class="feature-title">Compatibility with all browsers</h5>
<span id="feature-2-description" class="feature-description">The styles are tested on all browsers to analyze any bugs and if we find, we correct them.</span>
</li>
<li>
<h5 id="feature-3" class="feature-title">Modern techniques</h5>
<span id="feature-3-description" class="feature-description">We use modern techniques (CSS3 gradients, etc.) to stand out from others.</span>
</li>
<li>
<h5 id="feature-4" class="feature-title">Compatibility with the default XenForo products</h5>
<span id="feature-4-description" class="feature-description">The styles are worked not only for the forum software, but also for the default XenForo products (Media Gallery and Resource Manager).</span>
</li>
<li>
<h5 id="feature-5" class="feature-title">Optional copyright removal</h5>
<span id="feature-5-description" class="feature-description">By paying more for a style, you can remove the copyright ("Style by XenDesignFocus") of the style.</span>
</li>
</ul>
<ul>
<li>
<h5 id="feature-6" class="feature-title">Compatibility with any resolution</h5>
<span id="feature-6-description" class="feature-description">The styles are designed to be compatible on any resolution. They are responsive, so they will fit on tablet and mobile.</span>
</li>
<li>
<h5 id="feature-7" class="feature-title">High quality support</h5>
<span id="feature-7-description" class="feature-description">If you need help about a purchased style here, ask in the <a href="#" target="_blank" style="border-bottom: 2px solid;">support forum</a> so that we can fix your problem very quickly.</span>
</li>
<li>
<h5 id="feature-8" class="feature-title">Custom framework</h5>
<span id="feature-8-description" class="feature-description">All styles are based on a custom framework for features such as the ability to change the logo image with a HTML logo text, make the appearance of the avatars in rounded, put a custom node icon for each forum, etc.</span>
</li>
<li>
<h5 id="feature-9" class="feature-title">Extra features</h5>
<span id="feature-9-description" class="feature-description">In addition to the custom framework, some styles have custom features such as for example the possibility to enable the fixed header option, etc.</span>
</li>
<li>
<h5 id="feature-10" class="feature-title">Test title</h5>
<span id="feature-10-description" class="feature-description">Test</span>
</li>
</ul>
</div>
CSS:
#index-features
{
position: relative;
margin-top: 15px;
text-align: center;
}
#index-features li
{
border-bottom: #CCCCCC 1px solid;
margin: 0 -20px 20px -20px;
padding: 0 20px; 0 20px;
}
#index-features ul:last-child li:last-child
{
border-bottom: none;
}
.feature-title
{
display: inline-block;
font-weight: bold;
}
.feature-title:before
{
content: "";
float: left;
background: url("../images/index-features-sprite.png") no-repeat;
width: 32px;
height: 32px;
margin-right: 5px;
}
.feature-description
{
display: block;
margin: 0 0 20px 37px;
}
#feature-1:before
{
background-position: 0 0;
}
#feature-2:before
{
background-position: -32px 0;
}
#feature-3:before
{
background-position: -64px 0;
}
#feature-4:before
{
background-position: 0 -32px;
}
#feature-5:before
{
background-position: -32px -32px;
}
#feature-6:before
{
background-position: 0 -64px;
}
#feature-7:before
{
background-position: -32px -64px;
}
#feature-8:before
{
background-position: -64px -32px;
}
#feature-9:before
{
background-position: -64px -64px;
}
如您所见,我有两个 ul 标记,我想要的是将第一个 ul 转换为另一个 ul:http://prntscr.com/7ftax4第二个 ul:http://prntscr.com/7ftba6
想法是显示第一个 ul,10 秒后,第二个 ul 越过第一个 ul。
请问我如何使用 JavaScript 或 CSS 来实现?
最佳答案
这是一段 jQuery,它会在 <ul>
上连续添加一个事件类。元素。然后使用 CSS <ul>
.active
时可以隐藏和显示元素应用类
$(function(){
$('#index-features ul').first().addClass('active');
setInterval(loop,10000);
function loop(){
var $active=$('ul.active');
var $next=$active.nextAll('ul').first();
if($next.length===0)$next=$active.prevAll('ul').last();
$active.removeClass('active')
$next.addClass('active');
}
});
#index-features
{
position: relative;
margin-top: 15px;
text-align: center;
}
#index-features li
{
border-bottom: #CCCCCC 1px solid;
margin: 0 -20px 20px -20px;
padding: 0 20px; 0 20px;
}
#index-features ul:last-child li:last-child
{
border-bottom: none;
}
.feature-title
{
display: inline-block;
font-weight: bold;
}
.feature-title:before
{
content: "";
float: left;
background: url("../images/index-features-sprite.png") no-repeat;
width: 32px;
height: 32px;
margin-right: 5px;
}
.feature-description
{
display: block;
margin: 0 0 20px 37px;
}
#feature-1:before
{
background-position: 0 0;
}
#feature-2:before
{
background-position: -32px 0;
}
#feature-3:before
{
background-position: -64px 0;
}
#feature-4:before
{
background-position: 0 -32px;
}
#feature-5:before
{
background-position: -32px -32px;
}
#feature-6:before
{
background-position: 0 -64px;
}
#feature-7:before
{
background-position: -32px -64px;
}
#feature-8:before
{
background-position: -64px -32px;
}
#feature-9:before
{
background-position: -64px -64px;
}
#index-features ul {
position: absolute;
top: 0;
opacity: 0;
transition: opacity 0.5s;
}
#index-features ul.active {
opacity: 1;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="index-features">
<ul>
<li>
<h5 id="feature-1" class="feature-title">Instant access</h5>
<span id="feature-1-description" class="feature-description">After purchasing a style, there will be no waiting. Your account will be directly promoted in the "Customers" group and you will unlock access to all the features of the forum.</span>
</li>
<li>
<h5 id="feature-2" class="feature-title">Compatibility with all browsers</h5>
<span id="feature-2-description" class="feature-description">The styles are tested on all browsers to analyze any bugs and if we find, we correct them.</span>
</li>
<li>
<h5 id="feature-3" class="feature-title">Modern techniques</h5>
<span id="feature-3-description" class="feature-description">We use modern techniques (CSS3 gradients, etc.) to stand out from others.</span>
</li>
<li>
<h5 id="feature-4" class="feature-title">Compatibility with the default XenForo products</h5>
<span id="feature-4-description" class="feature-description">The styles are worked not only for the forum software, but also for the default XenForo products (Media Gallery and Resource Manager).</span>
</li>
<li>
<h5 id="feature-5" class="feature-title">Optional copyright removal</h5>
<span id="feature-5-description" class="feature-description">By paying more for a style, you can remove the copyright ("Style by XenDesignFocus") of the style.</span>
</li>
</ul>
<ul>
<li>
<h5 id="feature-6" class="feature-title">Compatibility with any resolution</h5>
<span id="feature-6-description" class="feature-description">The styles are designed to be compatible on any resolution. They are responsive, so they will fit on tablet and mobile.</span>
</li>
<li>
<h5 id="feature-7" class="feature-title">High quality support</h5>
<span id="feature-7-description" class="feature-description">If you need help about a purchased style here, ask in the <a href="#" target="_blank" style="border-bottom: 2px solid;">support forum</a> so that we can fix your problem very quickly.</span>
</li>
<li>
<h5 id="feature-8" class="feature-title">Custom framework</h5>
<span id="feature-8-description" class="feature-description">All styles are based on a custom framework for features such as the ability to change the logo image with a HTML logo text, make the appearance of the avatars in rounded, put a custom node icon for each forum, etc.</span>
</li>
<li>
<h5 id="feature-9" class="feature-title">Extra features</h5>
<span id="feature-9-description" class="feature-description">In addition to the custom framework, some styles have custom features such as for example the possibility to enable the fixed header option, etc.</span>
</li>
<li>
<h5 id="feature-10" class="feature-title">Test title</h5>
<span id="feature-10-description" class="feature-description">Test</span>
</li>
</ul>
</div>
关于JavaScript 或 CSS : How can I make a transition of one element to another?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30788046/
我并不总是编写 make 文件,但当我这样做时,我喜欢尝试并写好它们。试图使界面与其他开发人员的期望一致始终是一项艰巨的任务。我正在寻找的是所有常见的 make some clean (GNU) ma
例如,我在运行 makefile 时收到这样的错误: make[3]: *** [/home/ziga/Downloads/openwrt/rakun_openwrt/staging_dir/ho
我必须创建一个 Makefile,它从不同文件夹中的 .c 文件创建单个可执行文件。 .c 文件包含来自任何这些文件夹的头文件。根目录有3个子目录x/y、x/z、a,所有这些子目录都有一些.c和.h文
您好,我有一个简单的 MakeFile,其中包含: clean: rm -f ex1 但是当我运行命令make clean 时,出现以下错误: make: *** No rule to mak
我已经为一些软件安装了它,但现在我根本不使用那个软件,所以我需要移除MinGW才能使用Cygwin进行Android开发。。我使用的是64位Windows 7
以下是针对我遇到的问题的简化生成文件: all: /tmp/makey/../filey @echo All done /tmp/filey: @echo Filey 当我运行 mak
获取错误: make: *** No rule to make target all. Stop." 在安装nagios主机期间运行此命令make all 最佳答案 可能的常见错误: 确保将文件命名为
当使用 -jN 运行 gnu-make 规则时,make 会创建 jobserver用于管理跨子制造商的工作数量。此外,您可以通过在 make 配方前添加 + 前缀来“将作业服务器环境传递”到 mak
使用 GNU Make 4.1 概括 我调用一个子品牌 b.mk来自生成文件 a.mk .b.mk被调用以确保构建子系统。 有时我想强制一个目标为 a.mk重制: make -f a.mk --al
这个问题与问题 2543127 的精神相似。 . 我有一个带有头文件列表的 gnu makefile。每个头文件可能位于不同的目录中,例如, HEADERS = $(wildcard *.h) $(w
假设我有以下 GNU make 目标: create_dir: @mkdir objects build_asm: $(ASM_FILES) @echo
我有一个具有以下结构的 Makefile(工作示例)。 .PHONY: image flashcard put-files put-files: @echo "=== put-files" i
我想要一个这样的makefile: cudaLib : # Create shared library with nvcc ocelotLib : # Create shared li
有没有比更好的方法来获取 GNU make 变量的第一个字符 FIRST=$(shell echo $(VARIABLE) | head -c 1) (不仅笨重而且还要调用外部shell)? 最佳答案
我通常使用像 cmake 这样的高级构建系统来构建我的 C/C++ 代码。但是由于各种原因,我直接使用 GNU make。 我正在进行递归构建,其中每个目录都有一个 makefile。 我最近不得不将
我通常使用像 cmake 这样的高级构建系统来构建我的 C/C++ 代码。但是由于各种原因,我直接使用 GNU make。 我正在进行递归构建,其中每个目录都有一个 makefile。 我最近不得不将
我安装了最新的mingw,发现没有mingw32-make了。有make.exe,所以我想知道最近是否将mingw32-make重命名为make.exe。 最佳答案 我不知道您从哪里获得 MinGW,
我正在使用 CentOS,但由于一个错误,许多软件包被删除了。所以我没有 yum 和 rpm。所以我想从源代码手动制作 yum,但我也没有制作。我知道一切都会用“制作包”制作。但是 make 自己呢?
考虑这个Makefile: .PHONY: all all: main.txt main.txt: build/main.txt cp build/main.txt . %/main.txt:
假设目录输入中有 1000 个扩展名为 .xhtml 的文件,并且这些文件的某个子集(输出路径在 $(FILES) 中)需要通过 xslt 转换为目录输出中具有相同名称的文件.一个简单的 make 规
我是一名优秀的程序员,十分优秀!