[英]Wordpress - jQuery - easeOutBounce not working
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://www.learningjquery.com/js/jquery-1.7.1.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js">
</script>
<script>
$(document).ready(function(){
$('.homeslider, #left, #right').hover(function(){
$('.slidercaptions').animate({"height": "47px", "padding-top": "25px"}, {duration: 10, easing: 'easeOutBounce'});
}, function(){
$('.slidercaptions').animate({"height": "0", "padding-top": "0"}, 10);
})
})
</script>
Once hover in .homeslider element .slidercaptions should gain height and bounce. 将鼠标悬停在.homeslider元素中后,.slidercaptions应该会变高并反弹。 I don't know what I'm doing wrong.
我不知道我在做什么错。 Any clue would be appreciated.
任何线索将不胜感激。 Thanks
谢谢
PS I also included Easing plugin. 附言:我还包括了Easing插件。
<?php
wp_enqueue_script( 'easing' );
wp_enqueue_script( 'jquery-easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', false);
?>
You may use jquery-effects-core 您可以使用jquery-effects-core
function load_scripts() {
wp_enqueue_script('jquery');
wp_enqueue_script("jquery-effects-core");
}
add_action( 'wp_enqueue_scripts', 'load_scripts' );
It'll load the WP
's standard script and it contains the easing
functionality. 它将加载
WP
的标准脚本,并且包含easing
功能。 Use wp_enqueue_script to load scripts, this is the proper way to add scripts in WP
, also you have multiple versions of jQuery
linked. 使用wp_enqueue_script加载脚本,这是在
WP
添加脚本的正确方法,而且您链接了多个版本的jQuery
。
@Sheikh Heera - Thanks, I found my mistake, i was looking in the wrong file. @Sheikh Heera-谢谢,我发现了我的错误,我正在寻找错误的文件。 I forgot to remove my first style set for .slidercaptions in css file.
我忘了在CSS文件中删除.slidercaptions的第一个样式集。 Transitions should be removed.
过渡应该删除。
.slidercaptions{
-webkit-transition: all 1s ease-out;
-moz-transition: all 1s easen-out;
-ms-transition: all 1s ease-out;
-o-transition: all 1s ease-out;
transition: all 1s ease-out;
} }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.