[英]Trying to connect Smooth Div Scroll Jquery to my site but its not connecting?
Hi I am trying to connect Smooth Div Scroll to my site: http://Izzy.me 嗨,我正在尝试将Smooth Div Scroll连接到我的网站: http : //Izzy.me
Smooth Div Scroll is this: http://smoothdivscroll.com/ Smooth Div Scroll是这样的: http : //smoothdivscroll.com/
In the front page of Izzy.Me I have 3 pictures of birds that I am using as an example to see if Smooth Div Scroll is connected. 在Izzy.Me的首页中,我以3张鸟的图片为例来查看是否连接了Smooth Div Scroll。
This is the CSS of those pictures: 这是这些图片的CSS:
<div id="makeMeScrollable">
<img src="http://www.birds.com/wp-content/uploads/home/bird4.jpg" alt="Field" id="field" />
<img src="http://www.birds.com/wp-content/uploads/home/bird.jpg" alt="Gnome" id="gnome" />
<img src="http://3.bp.blogspot.com/-KFaKPd9ytxM/TxdKjRZulaI/AAAAAAAAD6A/w0kduvREq2w/s1600/bird-1-wallpaper-1024x768-853745.jpeg" alt="Pencils" id="pencils" />
</div>
In my child functions php I have this : 在我的子函数php中,我有这个:
<?php
function theme_javascript()
{
wp_enqueue_script( 'kinetic', get_template_directory_uri() . '/js/jquery.kinetic.min.js', array('jquery'), '20140109', true );
wp_enqueue_script( 'mousewheel', get_template_directory_uri() . '/js/jquery.mousewheel.min.js', array('jquery'), '20140109', true );
wp_enqueue_script( 'smoothdivscroll', get_template_directory_uri() . '/js/jquery.smoothdivscroll-1.3-min.js', array('jquery'), '20140109', true );
wp_enqueue_script( 'jquery-ui-1.8.23.custom', get_template_directory_uri() . '/js/jquery-ui-1.8.23.custom.min.js', array('jquery'), '20140109', true );
wp_enqueue_script( 'jquery-ui-1.10.3.custom', get_template_directory_uri() . '/js/jquery-ui-1.10.3.custom.min.js', array('jquery'), '20140109', true );
}
add_action( 'wp_enqueue_scripts', 'theme_javascript' );
?>
The file of the plugin that I downloaded from smoothscroll , includes both .min files and the full js files. 我从smoothscroll下载的插件文件包括.min文件和完整的js文件。 I just dragged and dropped the .min files into my parent themes JS folder and ignored the more complete .js files in the folder.
我只是将.min文件拖放到了父主题JS文件夹中,却忽略了该文件夹中更完整的.js文件。
I am not sure if my functions code is written right , because the name of the .min files confused me a little as to how to include them correctly. 我不确定我的函数代码编写是否正确,因为.min文件的名称使我对如何正确包含它们有些困惑。 So maybe thats why its not connecting ?
那么,也许这就是为什么它没有连接? the five names of the .min files are :
.min文件的五个名称是:
so looking back now at the functions php i included does it look right ? 所以现在回头看一下我包含的功能php,看起来正确吗? ( thanks for your help )
( 谢谢你的帮助 )
debug your javascript: 调试您的JavaScript:
Uncaught TypeError: Object function (e,t){return new x.fn.init(e,t,r)} has no method 'widget' - this error occurs if jQuery.UI is not connected
未捕获的TypeError:对象函数(e,t){返回新的x.fn.init(e,t,r)}没有方法'widget'-如果未连接jQuery.UI,则会发生此错误
try to find incompatible libraries: 尝试查找不兼容的库:
sample html: 范例html:
<div id="makeMeScrollable">
<img src="https://lh5.googleusercontent.com/-B5j3nmGIRLY/Uh3PDcFW1GI/AAAAAAAADmg/6qMAB1d7E4Y/w439-h612-no/DSC_1841-Edit_HDR-v2-w900-RP.jpg" alt="Field" id="field" />
<img src="https://lh3.googleusercontent.com/-5JUmqJ5zOho/Uf5xP9l5LcI/AAAAAAABB-U/dVkkiLJ3_PA/w857-h612-no/In+Living+Color+%25C2%25A9+Laurie+Rubin_LAR3452.jpg" alt="Gnome" id="gnome" />
<img src="https://lh5.googleusercontent.com/-NNtAD1d_Ekg/UgGad3929uI/AAAAAAAAXxc/oRerem5pkPg/w918-h612-no/Afternoon-2.jpg" alt="Pencils" id="pencils" />
</div>
sample javascript 示例javascript
$(document).ready(function () {
$("#makeMeScrollable").smoothDivScroll({
touchScrolling: true,
manualContinuousScrolling: true,
hotSpotScrolling: false,
mousewheelScrolling: false
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.