jQuery imgAreaSelect 用 jqModal 隐藏?
当我的 jqModal 窗口关闭时,尝试隐藏我的 imgAreaSelect 选择区域。我必须进行一些 z-index 修复才能使其在 jqModal 窗口内工作,但选择区域并没有消失,我留下了一个大的黑色覆盖层。不幸的是,由于某种原因,调用 imgAreaSelect 进行隐藏不起作用。
这是我当前的代码:
<script type="text/javascript">
var ias;
$().ready(function() {
ias = $('#prevImage').imgAreaSelect({ aspectRatio: '9:6', instance: true });
$('#cropImg').jqm({modal: true, trigger: '.showCrop'});
});
hideSelect() {
ias.setOptions({ hide: true });
ias.update();
}
</script>
<input type="button" class="showCrop">
<div id="cropImg">
<img border="0" src="IMAGES/preview.png" width="590" id="prevImage" />
<input type="button" onclick="hideSelect();" href="" class="jqmClose" value="Cancel">
</div>
非常感谢!
Trying to hide my imgAreaSelect selection area when my jqModal window closes. I had to do some z-index fixing to get this to work inside the jqModal window, but the selection area doesn't disappear and I'm left with a large black overlay. Unfortunately calling the imgAreaSelect to hide isn't working for some reason..
This is my current code:
<script type="text/javascript">
var ias;
$().ready(function() {
ias = $('#prevImage').imgAreaSelect({ aspectRatio: '9:6', instance: true });
$('#cropImg').jqm({modal: true, trigger: '.showCrop'});
});
hideSelect() {
ias.setOptions({ hide: true });
ias.update();
}
</script>
<input type="button" class="showCrop">
<div id="cropImg">
<img border="0" src="IMAGES/preview.png" width="590" id="prevImage" />
<input type="button" onclick="hideSelect();" href="" class="jqmClose" value="Cancel">
</div>
Thanks very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我正确理解你的问题,
ias.cancelSelection()
应该可以工作。ias.cancelSelection()
should work if I understood your question correctly.