- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对网络开发和编程完全陌生,我想在我的 WP 网站上使用 Scrollify。
所以我只想在一个页面中加载 Scrollify,所以我将它添加到 functions.php
function load_js_assets() {
if( is_page( 26 ) ) {
wp_enqueue_script('scrollify', 'https://goodlifesoft.com/scrollify.js', array('jquery'), '', false);
}
我在控制台中添加了一条消息,以查看文件已加载。
我在 header.php
加载了最新版本的 jquery<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
我在footer.php中调用了Scrollify函数
<script>
$(function() {
$.scrollify({
section : ".elementor-element.elementor-element.elementor-section-height-full.elementor-section-content-middle.elementor-section-boxed.elementor-section-height-default.elementor-section-items-middle.elementor-section.elementor-top-section",
});
});
</script>
这是我在控制台中收到的消息。来自控制台的内容
这在 JSfiddle 中对我有用 https://jsfiddle.net/Balodis/w697stj5/60/
如果有人能指出我做错了什么,我将不胜感激。
谢谢!
最佳答案
尝试在我的网站上实现类似的东西并让它工作时发现了这个线程 - 这是我所做的:
我下载了 scrollify.js 脚本并将其上传到我的 wordpress 子主题文件。
我使用子函数调用脚本.php
add_action('wp_enqueue_scripts', 'scroll_script');
function scroll_script() {
wp_enqueue_script(
'custom-script',
get_stylesheet_directory_uri().
'/jquery.scrollify.js',
array('jquery')
);
}
<script>
jQuery(function() {
jQuery.scrollify({
section : ".panel",
sectionName : "data-id",
interstitialSection : "",
easing: "easeOutExpo",
scrollSpeed: 1100,
offset : 0,
scrollbars: true,
standardScrollElements: "",
setHeights: true,
overflowScroll: true,
updateHash: true,
touchScroll:true,
before:function() {},
after:function() {},
afterResize:function() {},
afterRender:function() {}
});
});
</script>
当然,您必须将“Section”类编辑为您想要在自己的页面/布局中滚动的元素。
关于javascript - 如何将 Scrollify.js 与 Wordpress 和 Elementor 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54933229/
Elementor Pro 有一个新的小部件,视频播放列表。它将参数附加到 URL,如下所示:http://aaronpenton.net/ampcreative/vip/about-vip/?pla
我正在我的 WordPress 网站上的 Elementor 中创建页脚。我的页脚内容居中。现在我想在页脚中添加 iconlist widget。但是,它并没有按照我想要的方式居中。我希望图标在左侧保
我在使用 Elementor Wordpress 页面生成器时遇到了一个奇怪的问题。 创建自定义短代码并将其插入任何页面位置后,它也会显示在页面顶部,但仅在编辑模式下显示。 页面顶部: 我要插入短代码
我曾试图解决我的问题,但不幸的是我仍然没有找到正确的解决方案。 我想要的只是在第 1 列的左侧有白色背景,在第 2 列的右侧有灰色背景。 但是我在 Column 选项中找不到需要的属性(我不确定是否有
我正在做一个自定义 Elementor Widget(在 Wordpress 中),我正在尝试让一个 Select 控件将来自另一个控件的数据作为选项。这是我的代码 $property_types
我在我的 WordPress 网站上安装了 Elementor Pro,我正在编写一个自定义插件来执行一些操作并以编程方式创建一个新页面。我能够创建页面,但问题是,我想以编程方式在此新页面中插入一个
我想先保留我的自定义类别。有人可以提供帮助。 看到这个我的代码, function add_elementor_widget_categories( $elements_manager ) {
我想在单击我在 elementor 页面中添加的每个按钮时在全屏上添加灯箱弹出窗口。这可能吗?我已经设置了按钮 id,但不知道如何在插件中使用它 最佳答案 使用此插件(弹出窗口制作器):https:/
我一直在尝试弄清楚 Wordpress 中的 Elementor(和 Elementor Pro)插件正在做什么以使其脚本最后加载到正文中,因为我的插件脚本需要在这些之后加载。它需要在结束 body
我在 Elementor 中使用粘性菜单。在桌面上没问题。在移动设备上,粘性标题/菜单覆盖了第一个元素,但是当我滚动时,元素/页面跳下并留下空白。当我修复间距以使其最初可见时,会有更多的空白。如何停止
不确定这是否只是 Elementor 全宽模板的问题,但它似乎覆盖了主题 header.php。我尝试通过使用 elementor 自定义代码功能来实现我的目标,但它在标记中间的某个位置添加了我的代码
我正在为 WordPress 媒体库编写一个扩展,我需要向媒体库添加一个按钮,点击该按钮将打开一个模式窗口,用户可以从中选择图片。 看截图 screenshot 1 screenshot 2 目前,在
我想从自定义代码(HTML、CSS、Javascript)调用 Elementor Popup。有谁知道这是怎么做到的吗?提前致谢! 最佳答案 以下是通过 javascript 调用弹出窗口的方法:
我正在尝试更改由大约 400 个页面上存在的元素或页面构建器插件创建的页面中的值/文本。我已经用正确的值编辑了数据库 (wp_posts),但它在前端没有改变。这些值仍然是页面上的旧值。似乎某处正在缓
希望大家都过得好! 我正在通过 Elementor 插件在 WordPress 中创建一个网站。我在按钮上遇到了一个奇怪的问题。按钮有换行符 ,即使我没有在那里添加它。 但另一方面,该按钮在 Ele
我是 的新手WordPress , 但我有很好的经验 java 发展。我开发了一个小 WordPress 网站使用 海洋WP , 元素 .在主页中,我需要显示我网站中的注册成员(member)数量。
想要在简单的编辑器中切换我的 elementor 构建器界面,例如我网站上的旧 Html 编辑器 tellthebell * 由于这个构建器,我的网站加载缓慢。想知道我的内容是否会丢失或者只是设计会改
在 Elementor 中,默认情况下,如果我们在小部件内添加布局,我们可以看到小部件和布局(小部件的子级)之间存在间隙或空间,如下图所示: 有什么方法可以删除它,因为我仍然找不到它。 最佳答案 默认
在 Elementor 中,默认情况下,如果我们在小部件内添加布局,我们可以看到小部件和布局(小部件的子级)之间存在间隙或空间,如下图所示: 有什么方法可以删除它,因为我仍然找不到它。 最佳答案 默认
作为我的网站http://newwebsite.outfit24.com.au (仍在构建中)是基于图像的,我希望标题文本颜色发生变化,以便它从背景(深色和浅色图像)中脱颖而出。我已经使用 Eleme
我是一名优秀的程序员,十分优秀!