【JQuery】有点小提示

$("button").prop("disabled", true)—— prop操作属性

$("#target2").appendTo("#right-well")——转移元素到目标名下

$("#target2").clone().appendTo("#right-well")——先复制再转移元素到目标名下

$(".target:nth-child(3)").addClass("animated bounce");——选择第几个子元素【:nth-child(3)】

【Bootstrap】有点小提示

今日认真看了bootstrap的手册,感觉自己so Native。 成天写css来控制样式,其实有更懒得办法。

但是这个办法给我感觉很臃肿 ?例如 ?<button class="btn btn-primary btn-block"></button>

(⊙v⊙)嗯,蛋疼了,但我必须要记下来。说不定以后能偷懒

只写我会忘的 _(:з」∠)_

 

图片

class属性:

img-responsive——自适应屏幕宽度

 

button

class属性:

btn-block——块状并平铺100%

Font Awesome

<i class="fa fa-thumbs-up"></i>

 

wordpress 的parallax is not a function?我来帮你

搜狗截图20160624224918
最新解决方法:

在模板head。php文件引入cdn

wordpress\wp-content\themes\主题名称\header.php

<script src="//cdn.bootcss.com/jquery-parallax/1.1.3/jquery-parallax-min.js"></script>

//--------------以下为过时答案

点这里看原文
请看Rikard 的回答:

Please try adding the following to your functions.php file to see if that helps:

function modify_jquery() {
if (!is_admin()) {
	wp_deregister_script('jquery');
	wp_register_script('jquery', 'https://code.jquery.com/jquery-1.11.3.min.js');
	wp_enqueue_script('jquery');
}
}
add_action('init', 'modify_jquery');

把以上代码丢到主题文件夹的functions.php里面,但经过我的实际操作,这样没有效果。于是我想办法找到wp的head引用文件wordpress\wp-includes\general-template.php ?添加进里面就可以了。

好好享受wordpress带来的方便与快捷吧!

获取当前url并判断

$("a[href='"+ window.location.pathname +"']").parent().attr("class","active");
/**/

设置或获取对象指定的文件名或路径。

alert(window.location.pathname)

 
设置或获取整个 URL 为字符串。

 
alert(window.location.href);

设置或获取与 URL 关联的端口号码。

alert(window.location.port)

 
设置或获取 URL 的协议部分。

alert(window.location.protocol)

 
设置或获取 href 属性中在井号“#”后面的分段。

alert(window.location.hash)

 
设置或获取 location 或 URL 的 hostname 和 port 号码。

alert(window.location.host)

 
设置或获取 href 属性中跟在问号后面的部分。

alert(window.location.search)