【发布时间】:2015-09-19 09:29:29
【问题描述】:
我制作了一个从 AJAX 加载内容的模式,当您单击投资组合项目时它会打开,所以效果很好:) 但我无法让它淡入,我无法让模式关闭在交叉点击上,我也需要淡出。任何帮助将不胜感激!!我已经尝试了我能想到的一切,我不明白为什么它不起作用。
点击打开模态
<a href="works/blk.html" rel="modal:open" class="wolf-media-link" ><img src="img/heno/featured.jpg" alt="Heno"></a>
blk.html 内容
<div class="closex"><div class="inner-closex"></div></div>
<div class="modalwindow">
<section class="portfolio-item blk">
<div id="description">
<h1>Blk Sport</h1>
<h4>Graphic Design</h4>
<p>BLK is an international sports company I worked for as a graphic designer. Some of my work included print design such as product catalogues and advertisements, EDMs, social media designs, logo designs, user interface design and web design. The web design and product range logo below are purely a conceptual pitch. </p>
</div>
<img id="blkwebimage"src="img/blk/web.png">
</section>
</div>
JS
// this needs to fade in
$('.wolf-media-link').click(function(event) {
event.preventDefault();
$.get(this.href, function(html) {
$(html).appendTo('body');
});
});
$('.closex').on('click', function() {
//close the modal with a fade out effect
});
听说是我正在尝试使用的网站,请单击投资组合项目 :) http://arielbeninca.com/ariel.com/
您不知道我会多么感激您的帮助! 非常感谢!!!!
【问题讨论】:
-
你在`body中附加了接收到的ajax内容,为什么?为什么不在 div 中?您的模态窗口 div 是哪个必须保存 ajax 数据?
-
感谢您的评论 模态内容来自一个单独的 html 文件,您可以访问该网站并在单击它时查看我拥有的内容 它打开 :) 只是关闭问题...
-
使用
$('.closex').on('click', function() { $('.modalwindow').fadeOut(); }); -
仍然无法正常工作>.
标签: jquery css ajax fadein simplemodal