hello!   好久不见了 ,今天也没准备什么技术,知识想和大家就见个面,一个js判断奇数偶数来实现css样式 ,感觉最大的用途就是页面的导航。就这么一个小小的技术。

劳动快乐

 

当!当!当!当!

 

这就是判断奇偶数实现的立体按钮,配色好的自行更改 ,下面是我抛给大家的代码:

 

css:代码

<style type="text/css">
body{
width: 400px;
height: 300px;
margin: 0 auto;
margin-top: 60px;
}
#div{
width: 130px;
height: 0px;
border-radius:0px 0px 5px 5px;
background-color: #808080;
box-shadow: 0 9px 0 #808080, 0 3px 25px rgba(0, 0, 0, 0.7);
transition: all .3s;
margin-top: 3px;
color: #FFFFFF;
font-size: 20px;
font-weight: bold; overflow: hidden;
text-align: center; }
#div p{
text-shadow: 0px 0px 0px #272822;
transition: all 2.5s;
}
.button{
width: 130px;
height: 35px;
border-radius: 4px;
box-shadow: 0 9px 0 #DB1F05, 0 9px 25px rgba(0, 0, 0, 0.7);
background-color: #DB5705;
transition: all 0.1s;
text-align: center;
line-height: 35px;
font-size: 14px;
color: #FFFFFF;
user-select:none;
cursor: pointer;
font-weight:; } </style>

HTML代码:

<div class="button" onclick="dianji()">点我点我</div>
<div id="div"><p>萨</p><p>瓦</p><p>迪</p><p>卡</p></div>

jquery代码:

<script type="text/javascript">
var x=0;
function dianji(){
x++;
//判断奇偶数利用jquery实现效果 if(x%2==0){
$("#div").css({
"height": "0px",
})
$(".button").css({
"box-shadow": "0 9px 0 #DB1F05, 0 9px 25px rgba(0, 0, 0, 0.7)",
})
$("p").css({
"text-shadow": "0px 0px 0px #272822"
}) }else{
$("#div").css({
"height": "200px", })
$(".button").css({
"box-shadow":" 0 3px 0 #DB1F05, 0 3px 6px rgba(0, 0, 0, 0.9)",
})
$("p").css({
"text-shadow": "5px 5px 5px #272822"
   })
}
}
</script>

最后

 
 

                                                                                        祝大家度过一个愉快的五一假期,拜~

js判断奇偶数实现隐藏显示功能 与css立体按钮的更多相关文章

  1. C#判断奇偶数的函數

    // 现代流行的"程序员" public static bool IsOdd(int n) { while (true) { switch (n) { : return true; ...

  2. js 判断某个元素是否隐藏或显示

    //判断某个元素是否显示 true:是 false:不是 var isVisible = $('#myDiv').is(':visible'); //判断某个元素是否隐藏 true:是 false:不 ...

  3. JS实现奇偶数的判断

    <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>标题页-学无忧(www.x ...

  4. 【转】C#判断奇偶数的函数

    // 现代流行的"程序员" public static bool IsOdd(int n) { while (true) { switch (n) { : return true; ...

  5. C#判断奇偶数的函数

    // 现代流行的"程序员"public static bool IsOdd(int n) {     while (true)    {        switch (n)     ...

  6. Dynamics CRM2011中通过JS脚本方式显示和隐藏ribbon中的自定义按钮

    首先该方法不能写在页面的onload中,因为当从子网格返回常规表单的时候ribbon区域会重新加载而常规表单所在的iframe区域是不会被刷新的,所以如果写在onload中的话就控制的不那么完全了,我 ...

  7. JS判断键盘是否按的回车键并触发指定按钮点击操作

    document.onkeydown = function (e) { if (!e) e = window.event; if ((e.keyCode || e.which) == 13) { va ...

  8. js 判断滚动条是否停止滚动

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  9. PHP 与操作判断奇偶

    /** * 判断奇偶数 * @param $n * @return int */ function isOdd($n){ // $a & $b And(按位与) 将把 $a 和 $b 中都为 ...

随机推荐

  1. 阿里云API网关(4)快速入门(开放 API)

    网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl 网关控制台: https ...

  2. 云计算(2)it 是什么

    2015年,全世界在it上面的花费达到3亿8千亿美金之多. 云数据中心:核心基础架构,云计算的物理载体,提供数据处理.存储和高性能计算支撑,包括服务器.存储.冷却.机房空间和能耗管理等. 超大规模的云 ...

  3. Python之线程

    操作系统线程理论 线程概念的引入背景 进程 之前我们已经了解了操作系统中进程的概念,程序并不能单独运行,只有将程序装载到内存中,系统为它分配资源才能运行,而这种执行的程序就称之为进程.程序和进程的区别 ...

  4. 解析 Javascript - this

    在函数中 this 到底取何值,是在函数真正被调用执行的时候确定下来的,函数定义的时候确定不了.  因为 this 的取值是执行上下文环境的一部分,每次调用函数,都会产生一个新的执行上下文环境.当你在 ...

  5. HTNL表单详解

    HTML表单 表单的结构 表单的标签:<form> </form> 常用属性 Name , method(get,post), action(服务器的接收的页面如:reg.ph ...

  6. Java:Java 中会存在内存泄漏吗

    理论上Java因为有垃圾回收机制(GC)不会存在内存泄露问题(这也是Java被广泛使用于服务器端编程的一个重要原因):然而在实际开发中,可能会存在无用但可达的对象,这些对象不能被GC回收,因此也会导致 ...

  7. github git 在GitHub上创建项目并将本地项目push到网站上

    众所周知,git是与svn类似的版本控制系统,git的去中心化.分布式等的优点,在不久将来用户量大有可能超过svn, 常见的代码托管网站有GitHub,coding.net, gitee.com 码云 ...

  8. [LeetCode] Merge Two Binary Trees 合并二叉树

    Given two binary trees and imagine that when you put one of them to cover the other, some nodes of t ...

  9. NC帮助文档网址

    NC帮助文档:                https://wenku.baidu.com/view/2d05a77c0b4e767f5acfceb6.html NC方法总结:            ...

  10. Centos6.9连接工具设置

    由于vm下面的centos6.9这种操作环境非常的不友好,用起来非常的不方便, 所以我们需要用一个远程连接工具来连接,我们的虚拟机.我们使用的是teraterm. 下载地址:https://osdn. ...