Dev
搜索

Dev

wordpress get_the_title 和 the_title函数
发表于2015-11-23|wordpress
get_the_title 和 the_title 两个函数用来在文章页面显示文章标题的函数, the_title 默认直接显示,get_the_title 默认返回字符串 [pcsh lang=”php” tab_size=”4” message=”” hl_lines=”” provider=”manual”] <?php the_title( $before, $after, $echo ); ?> [/pcsh] $before标题前的字符 $after标题后的字符 $echo显示、还是返回字符串,默认为true [pcsh lang="php" tab_size="4" message="" hl_lines="" provider="manual"] <?php $myTitle = get_the_title($ID); ?> [/pcsh]    
jQuery 属性操作 - addClass() 方法
发表于2015-11-23|jq
实例 向第一个 p 元素添加一个类: [pcsh lang=”js” tab_size=”4” message=”” hl_lines=”” provider=”manual”] $("button").click(function(){ $("p:first").addClass("intro"); }); [/pcsh]   使用函数来添加类 使用函数向被选元素添加类。 语法 [pcsh lang="js" tab_size="4" message="" hl_lines="" provider="manual"] $(selector).addClass(function(index,oldclass)) [/pcsh] function(index,oldclass) 必需。规定返回一个或多个待添加类名的函数。 index - 可选。选择器的 index 位置。 class - 可选。选择器的旧的类名。
使用wordpress内置的admin-ajax.php实现ajax功能
发表于2015-11-23|wordpress
这里一个特殊的地方是执行的hook名,执行的hook的名字是与post过来的数据有关的,如下面do_action所示 这个文件是 WordPress 内置用来进行 Ajax 读取的文件,本来是用于后台的,但是前台我们也可以拿来用。 用这个文件进行 Ajax 的好处主要有几点: 安全,WordPress 本身进行了很复杂的安全性优化,如果我们都自己写是很浪费时间和资源的。兼容,由于文件是公用的,提供了通用的钩子,其它插件都可以参与进去。高效,这个不解释了,既符合原则(执行到了 init 钩子),又兼顾了效率问题。方便,一个钩子即可输出代码,都不用判断条件。基本就这几点了,网上查了一下,发现关于此文件的资料并不多,于是看了下源码,发现使用其实很简单。 首先请求这个文件: [pcsh lang=”php” tab_size=”4” message=”” hl_lines=”” provider=”manual”] echo admin_url( 'admin-ajax.php' ); [/pcsh] 向ad...
jquery获取窗口高度
发表于2015-11-23|jq
[pcsh lang=”js” tab_size=”4” message=”” hl_lines=”” provider=”manual”] alert($(window).height()); //浏览器窗口可视区域高度 alert($(document).height()); //浏览器当前窗口文档的高度 alert($(document.body).height());//浏览器当前窗口文档body的高度 alert($(document.body).outerHeight(true));//窗口body的总高度 包括border padding margin alert($(window).width()); //浏览器当前窗口可视区域宽度 alert($(document).width());//浏览器当前窗口文档对象宽度 alert($(document.body).width());//浏览器当前窗口文档body的高度 alert($(document.body).outerWidth(true));/...
js获取窗口高度
发表于2015-11-23|js
[pcsh lang=”js” tab_size=”4” message=”” hl_lines=”” provider=”manual”] var s = "网页可见区域宽 :"+ document.body.clientWidth; s += "\r\n网页可见区域高:"+ document.body.clientHeight; s += "\r\n网页可见区域高:"+ document.body.offsetHeight +" (包括边线的宽)"; s += "\r\n网页正文全文宽:"+ document.body.scrollWidth; s += "\r\n网页正文全文高:"+ document.body.scrollHeight; s += "\r\n网页被卷去的高:"+ document.body.scrollTop; s += "\r\n网页被卷去的左:"+ ...
jquery not函数用法@jquery删除一个或多个元素
发表于2015-11-21|jq
示例 $(obj).siblings().not(“.clear,span”)
css absolute relative定位
发表于2015-11-21|jq
absolute是绝对定位;而relative是相对定位;解释:绝对定位就是相对于父元素的定位,不受父元素内其他子元素的影响;而相对定位是相对于同级元素的定位,也就是上一个同级元素 static 默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。 fixed 生成绝对定位的元素,相对于浏览器窗口进行定位。 元素的位置通过 “left”, “top”, “right” 以及 “bottom” 属性进行规定。 inherit 规定应该从父元素继承 position 属性的值。
jQuery 效果 - animate() 方法
发表于2015-11-21|jq
原文地址:http://www.w3school.com.cn/jquery/effect_animate.asp 经过实际检验,这个style的值,比如“height”貌似不能为百分比,最好是px 例如: [pcsh lang=”js” tab_size=”4” message=”” hl_lines=”” provider=”manual”] $("#shadow1").animate({height:"300px"},"slow"); // 可以通过 $("#shadow1").animate({height:"100%"},"slow"); // 不可以通过 [/pcsh] 实例 改变 "div" 元素的高度: $(".btn1").click(function(){ $("#box").animate({height:"300px"}); }); $(selector).animate(styles,spe...
jQuery 遍历 - eq() 方法
发表于2015-11-21|jq
通过为 index 为 2 的 div 添加适当的类,将其变为蓝色: $("body").find("div").eq(2).addClass("blue"); 定义和用法 eq() 方法将匹配元素集缩减值指定 index 上的一个。 语法 .eq(index) 参数 描述 index 整数,指示元素的位置(最小为 0)。 如果是负数,则从集合中的最后一个元素往回计数。
jQuery -eq() 选择器
发表于2015-11-21|jq
实例 选择第二个 <p> 元素: $("p:eq(1)")
1…888990…102
avatar
developer
AI相伴的开发者博客
文章
1018
标签
718
分类
34
Follow Me
公告
This is my Blog
最新文章
cmder使用记录2026-03-08
flutter getx使用记录2026-03-01
统计代码行数2026-02-27
php easywechat 6.x 微信支付 手动解密2026-02-25
php 反引号 执行shell脚本2026-02-25
分类
  • apicloud3
  • bootstrap8
  • cmder1
  • cocos2d-js5
  • createjs17
  • day45
  • docker16
  • egret14
标签
公众号 格式化 权限 mysql_fetch_object thinkphp face++ mysql_fetch_row 云服务器 微信支付 is_singular td 转换 获取真实 Function [object Object] 去掉小程序边框线 date 备忘录 开放平台 Post Formats 队列 外泄的 soffice PHP unable current 豆腐 继续滑动一会 tp 备份 zip命令 dl animate动画 redis 文本搜索 算法 和 查看 parse_str 对象存储
归档
  • 三月 2026 2
  • 二月 2026 5
  • 一月 2026 3
  • 十二月 2025 5
  • 十一月 2025 2
  • 十月 2025 5
  • 九月 2025 5
  • 八月 2025 2
网站信息
文章数目 :
1018
最后更新时间 :
© 2025 - 2026 By developer框架 Hexo 8.1.1|主题 Butterfly 5.5.4
搜索
数据加载中