我如何使用这个超大 jquery 插件的 api [英] How do i use this api of supersized jquery plugin

查看:21
本文介绍了我如何使用这个超大 jquery 插件的 api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,正在使用超大插件.我想根据加载的幻灯片更改页面中的内容.在文档中,我找到了相关的 api,但不知道怎么做.

Hi am using supersized plugin. I want to change the content in the page depending on what slide is loaded. In the documentation i found the api for that, but couldn't figure out how to do it.

以下是文档的复制粘贴

theme.afterAnimation( )

每次幻灯片切换完成时运行.

Runs each time a slide transition is completed.

trigger : 在每次幻灯片过渡之后

http://buildinternet.com/project/supersized/docs.html#主题之后

如果我想在每次幻灯片更改后提示 alert('slide changed!'); 会怎样?我只是无法理解如何使用 这些 api'.

If i want to prompt alert('slide changed!'); after each slide change how would it be? I just cant understand how these apis' could be used.

推荐答案

我是 Supersized 的创建者,我想来这里帮助您解决这个问题.

I'm the creator of Supersized and I wanted to pop in here and help you straighten this out.

在实际下载中,位于此处,您会注意到幻灯片文件夹中有一个主题文件夹,与 js 和 css 文件夹分开 - 这是我们将关注的区域.

In the actual download, located here, you'll notice that within the slideshow folder there is a theme folder, separate from the js and css folders - this is the area we'll focus on.

超大运行分两部分:

  1. 基本文件 (js/supersized.3.2.x & css/supersized.css) 包含基本功能,例如转换、next/上一张幻灯片,以及所有其他基本组件.

  1. The base files (js/supersized.3.2.x & css/supersized.css) which contain the base functionality such as transitions, next/prev slide, and all the other essential components.

主题文件 (位于主题文件夹中) 允许您使用自定义修改幻灯片,例如您提到的那个,或者诸如进度之类的东西每张幻灯片的条形和自定义内容.这些是分开的,以防止您在每次更新基本文件时丢失自定义设置,以前的版本就是这种情况.

The theme files (located in the theme folder) which allow you to modify the slideshow with customizations, like the one you mentioned, or things like progress bars and custom content for each slide. These are separated to prevent you from losing the customizations every time there is an update to the base files, which was the case in previous versions.

在下载中,我包含了 Shutter 主题,我打算让人们将其用作自己开发的基础.不要担心触及基本文件 - 它们会自动调用主题文件,您的所有更改都将在该文件中进行.

In the download, I have included the Shutter theme, which I intended for people to use as a foundation for their own development. Don't worry about touching the base files - they automatically call the theme files, which is where all of your changes will go.

如果您打开theme/supersized.shutter.js,您会注意到主题对象字面量中有许多函数 - 这是您将放入主题函数的地方文档中描述.请记住,一旦编辑它,您将需要更新演示 html 页面上的路径以指向该文件,因为默认情况下它指向缩小的 theme/supersized.shutter.min.js.

If you open up theme/supersized.shutter.js, you'll notice there are are number of functions within the theme object literal - this is the place where you would drop in the theme functions described in the documentation. Keep in mind that you will need to update the path on the demo html page to point to this file once you edit it, since by default it points to the minified theme/supersized.shutter.min.js.

如果你滚动到 supersized.shutter.js 的底部,你会注意到你正在寻找的 afterAnimation 函数——这是你可以插入 alert('Slide Changed'); 行.

If you scroll towards the bottom of supersized.shutter.js, you'll notice the afterAnimation function you're looking for - this is where you can plug in the alert('Slide Changed'); line.

从那里您可以自由地删除不需要的任何功能并构建您自己的主题.

From there you're free to strip out whatever functions you don't need and build out your very own theme.

希望对您有所帮助,非常感谢您使用该插件!

Hope that helps and a big thank you for using the plugin!

最好的,山姆·邓恩

这篇关于我如何使用这个超大 jquery 插件的 api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆