如何在页面加载时自动打开图库的缩略图包装? (jQuery)
我需要告诉你,我对 jquery 很陌生,还在学习中,请不要笑。我想在我的网站上有一个图片库,并发现了这个使用 jquery 的漂亮图库。这是它的链接:
http://tympanus.net/Tutorials/ThumbnailsNavigationGallery/
所以有此代码片段可帮助用户单击相册或更确切地说单击它旁边的箭头,以打开和关闭相册的缩略图包装。我想要的只是当网页完全加载时第一个相册自动打开。我想我们可能必须使用 .load() 方法,但我不确定如何使用它。此处插入的代码具有打开和关闭相册的功能,我只是想自动化打开部分。
//clicking on the menu items (up and down arrow)
//makes the thumbs div appear, and hides the current
//opened menu (if any)
$list.find('.st_arrow_down').live('click', function () {
var $this = $(this);
hideThumbs();
$this.addClass('st_arrow_up').removeClass('st_arrow_down');
var $elem = $this.closest('li');
$elem.addClass('current').animate({
'height': '170px'
}, 200);
var $thumbs_wrapper = $this.parent().next();
$thumbs_wrapper.show(200);
});
$list.find('.st_arrow_up').live('click', function () {
var $this = $(this);
$this.addClass('st_arrow_down').removeClass('st_arrow_up');
hideThumbs();
});
我尝试向该脚本的原作者寻求帮助,但不幸的是她没有回应。期待您的帮助。提前致谢!!
I need to tell you that i'm very new to jquery and still learning, please don't laugh at this. I wanted to have an image gallery on my website and found this beautiful gallery that uses jquery. Here is the link for it:
http://tympanus.net/Tutorials/ThumbnailsNavigationGallery/
So there is this snippet that helps the user to click on the album or rather the arrow next to it, to open and close the thumbnail wrapper for the album. All I want is for the first album to open automatically when the webpage is loaded completely. I guess we might have to use the .load() method but I'm not sure how to use it. The code that is inserted here has both the functions to open and close the album, I just wanted to automate the opening part.
//clicking on the menu items (up and down arrow)
//makes the thumbs div appear, and hides the current
//opened menu (if any)
$list.find('.st_arrow_down').live('click', function () {
var $this = $(this);
hideThumbs();
$this.addClass('st_arrow_up').removeClass('st_arrow_down');
var $elem = $this.closest('li');
$elem.addClass('current').animate({
'height': '170px'
}, 200);
var $thumbs_wrapper = $this.parent().next();
$thumbs_wrapper.show(200);
});
$list.find('.st_arrow_up').live('click', function () {
var $this = $(this);
$this.addClass('st_arrow_down').removeClass('st_arrow_up');
hideThumbs();
});
I tried getting help from the original author of this script but unfortunately she is not responding. Looking forward to your kind assistance. Thanks in advance!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这 2 行:
并
搜索 class="st_arrow_down" 或 class="st_arrow_down" 的 HTML 元素
并在这些上绑定事件“单击”
此代码
当 DOM 准备好时,您搜索第一个专辑然后显示动画并显示 imgs
再见
This 2 lines:
and
search for HTML elements with class="st_arrow_down" or class="st_arrow_down"
and bind event "click" on these
This code on
When DOM is ready, you search first album then show animation and display the imgs
Bye