Jquery Accordion / Scrollto 但需要淡入和淡出?
我是一名平面设计师,但在 jquery 方面并不是最懂网络!这是我目前的困境;我有一系列链接,我想在手风琴中打开并在顺序列表中显示图像,其中滚动导航到单击的链接并在单击链接时淡入和淡出,这就是我发现的除了淡入淡出之外的做法: http://jsfiddle.net/Jaybles/6EWAF/
这是一个显示淡入和淡出的链接我想要使用相同的手风琴,我只想将这两种风格结合起来! http://nekudacom.com/martimi/flash.html#
该链接是 JSFiddle 提供的Dutchie432 如果有人可以帮助我将这两者实现在一起,或者使用将手风琴与滚动和淡入淡出组合在一起的更好方法,那就太棒了!
这是我的 HTML
<dt><a href="#"><h3><span class="redtext">/</span> yaya Photography</h3></a></dt>
<dd style="display: none; opacity: 0;" class="closed">
<ul>
<li> <img src="images/yaya_spacing_white.png" alt="yaya_spacing_white" width="600" height="406" /></li>
<li><img src="images/yayaspacing_black.png" alt="yayaspacing_black" width="600" height="406" /></li>
<li><img src="images/yaya_logo.png" alt="yaya_logo" width="601" height="401" /></li>
<li><img src="images/yaya_typography.png" alt="yaya_typography" width="600" height="402" /></li>
<li><img src="images/yaya_business_colors.png" alt="yaya_business_colors" width="600" height="403" /></li>
<li><img src="images/yaya_buscab.png" alt="yaya_buscab" width="600" height="600" /></li>
<li><img src="images/yaya_papers.png" alt="yaya_papers" width="600" height="400" /></li>
<li><img src="images/yaya_usb.png" alt="yaya_usb" width="600" height="400" /></li>
<li><img src="images/yaya_website.png" alt="yaya_website" width="600" height="359" /></li>
<li><img src="images/yaya_website_home.png" alt="yaya_website_home" width="600" height="360" /></li>
<li><img src="images/yaya_website_contact.png" alt="yaya_website_contact" width="600" height="360" /></li>
<li><img src="images/yaya_website_gallery.png" alt="yaya_website_gallery" width="600" height="360" /></li>
<li><img src="images/yaya_shirts1.jpg" alt="yaya_shirts1" width="600" height="400" /></li>
</ul>
</dd>
这是 jquery 脚本
$(document).ready(function(){
$("dd:not(dd.open)").hide();
$("dt a").click(function(){
if ($("dd:not:visible") .get()[0] !== $(this).parent().next().get()[0]) {
$("dd").fadeTo("fast", 0);
$("dd:visible").slideUp("slow");
$(this).parent().next().slideDown("def");
$(this).parent().next().fadeTo("def", 1);
}
return true;
});
I am a graphic designer but not the most web savvy when it comes to jquery! This is currently my dilemma; I have a series of links that I want to open in accordion and display images in sequential list where scroll to navigates to the link clicked and fades in and out as links are clicked, this is what I found that does this except the fading:
http://jsfiddle.net/Jaybles/6EWAF/
and heres a link showing the fade in and out I am after with the same accordion I just want to combine these two styles!
http://nekudacom.com/martimi/flash.html#
The link is the JSFiddle provided Dutchie432 if any one can help me implement both these two together or a better way about using putting together an accordion with scrollto and fading would be awesome!
Here is my HTML
<dt><a href="#"><h3><span class="redtext">/</span> yaya Photography</h3></a></dt>
<dd style="display: none; opacity: 0;" class="closed">
<ul>
<li> <img src="images/yaya_spacing_white.png" alt="yaya_spacing_white" width="600" height="406" /></li>
<li><img src="images/yayaspacing_black.png" alt="yayaspacing_black" width="600" height="406" /></li>
<li><img src="images/yaya_logo.png" alt="yaya_logo" width="601" height="401" /></li>
<li><img src="images/yaya_typography.png" alt="yaya_typography" width="600" height="402" /></li>
<li><img src="images/yaya_business_colors.png" alt="yaya_business_colors" width="600" height="403" /></li>
<li><img src="images/yaya_buscab.png" alt="yaya_buscab" width="600" height="600" /></li>
<li><img src="images/yaya_papers.png" alt="yaya_papers" width="600" height="400" /></li>
<li><img src="images/yaya_usb.png" alt="yaya_usb" width="600" height="400" /></li>
<li><img src="images/yaya_website.png" alt="yaya_website" width="600" height="359" /></li>
<li><img src="images/yaya_website_home.png" alt="yaya_website_home" width="600" height="360" /></li>
<li><img src="images/yaya_website_contact.png" alt="yaya_website_contact" width="600" height="360" /></li>
<li><img src="images/yaya_website_gallery.png" alt="yaya_website_gallery" width="600" height="360" /></li>
<li><img src="images/yaya_shirts1.jpg" alt="yaya_shirts1" width="600" height="400" /></li>
</ul>
</dd>
Here is the jquery script
$(document).ready(function(){
$("dd:not(dd.open)").hide();
$("dt a").click(function(){
if ($("dd:not:visible") .get()[0] !== $(this).parent().next().get()[0]) {
$("dd").fadeTo("fast", 0);
$("dd:visible").slideUp("slow");
$(this).parent().next().slideDown("def");
$(this).parent().next().fadeTo("def", 1);
}
return true;
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
change: function(event, ui) { ...}
或changestart: function(event, ui) { ...}
定义打开手风琴时会发生什么。 <代码>
ui.newContent` 是一个带有新打开的内容元素的 jQuery 对象。
请在此处查看完整文档(“事件”选项卡)
Use
change: function(event, ui) { ...}
orchangestart: function(event, ui) { ...}
to define what happens when you open the accordion.
ui.newContent` is a jQuery object with the newly opened content element.See full documentation here (events tab)