我为更改div 编写了一个简单的代码...... 但我认为如果它会自动切换一些超时会很好。
A 创造了一切,唯一的问题是我不是 js 程序员。
如果可能的话,HTML A 想保持现在这样。我只会更改 js。我认为js代码不好,但必须以某种方式开始:)
HTML -->
<div class="container">
<!-- helper class -->
<div class="green-section hover push">
<div class="col-md-3"></div>
<!-- Text inner -->
<div class="col-md-6">
<div class="text-inner">
<p class="text-centered web-description"><span class="webdesign">Work
great on all device <i class="icon-magic"></i></span> Lorem ipsum
dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
</p>
<p class="text-centered app-description"><span class="appdev">Mobile
friendly <i class="icon-beaker"></i></span> Lorem ipsum dolor sit
amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</p>
<p class="text-centered doc-description"><span class="doc">Detailed
documentation <i class="icon-info"></i></span> Lorem ipsum dolor sit
amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
</p>
<p class="text-centered clean-description"><span class="clean">Clean
code <i class="icon-list-ul"></i></span> Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
</p>
</div>
</div>
<!-- Text inner end -->
<!-- helper class -->
<div class="col-md-3"></div>
</div>
</div>
<!-- ||||| Welcome End ||||| -->
<!-- ||||| Features ||||| -->
<div class="container">
<div class="features">
<!-- first box -->
<div class="col-md-3 padding-5 dark text-center btn1 hover"><i class="icon-3x icon-code"></i>
</div>
<!-- second box -->
<div class="col-md-3 padding-5 dark text-center btn2 hover"><i class="icon-3x icon-copy"></i>
</div>
<!-- third box -->
<div class="col-md-3 padding-5 dark text-center btn3 hover"><i class="icon-3x icon-mobile-phone"></i>
</div>
<!-- fourth Box -->
<div class="col-md-3 padding-5 laptop-bg text-center btn4 hover"><i class="icon-3x icon-laptop"></i>
</div>
</div>
<!-- features end -->
</div>
<!-- container end -->
JS
$(".btn1").on("click", function () {
$('.btn1').css("background-color", "#7fe5b2");
$('.btn2,.btn3,.btn4').css("background-color", "#222222");
});
$(".btn2").on("click", function () {
$('.btn2').css("background-color", "#7fe5b2");
$('.btn3,.btn4,.btn1').css("background-color", "#222222");
});
$(".btn3").on("click", function () {
$('.btn3').css("background-color", "#7fe5b2");
$('.btn4,.btn2,.btn1').css("background-color", "#222222");
});
$(".btn4").on("click", function () {
$('.btn4').css("background-color", "#7fe5b2");
$('.btn3,.btn2,.btn1').css("background-color", "#222222");
});
$(".toggle-btn").on("click", function () {
$('.green-section').css("background", "#222222");
});
$(".btn3").on('click', function (e) {
e.preventDefault();
e.stopPropagation();
$(".app-description").show();
$(".web-description, .clean-description, .doc-description").hide();
});
$(".btn4").on('click', function (e) {
e.preventDefault();
e.stopPropagation();
$(".web-description").show();
$(".app-description, .clean-description, .doc-description").hide();
});
$(".btn2").on('click', function (e) {
e.preventDefault();
e.stopPropagation();
$(".doc-description").show();
$(".app-description, .clean-description, .web-description").hide();
});
$(".btn1").on('click', function (e) {
e.preventDefault();
e.stopPropagation();
$(".clean-description").show();
$(".app-description, .web-description, .doc-description").hide();
});
对不起我的英语......谢谢你的帮助:)