从元素中删除jquery imgareaselect插件 [英] Removing jquery imgareaselect plugin from element

查看:89
本文介绍了从元素中删除jquery imgareaselect插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在使用这个整洁的jquery插件 http://odyniec.net/projects/imgareaselect/
它运行正常,但我用jquery ui回调函数(对话框)触发它,我需要在对话框关闭后删除选择。

So im using this neat jquery plugin http://odyniec.net/projects/imgareaselect/ It works fine, but i'm firing it with jquery ui callback function (dialog), and i need to remove the selection after dialog closes.

function initialize_selection() {
$('#image_area').imgAreaSelect({ x1: 10, y1: 10, x2: $('#image_area').width()-10, y2: $('#image_area').height()-10 , fadeSpeed: 400, handles: true});
}

$(function() {
$('#image_edit').click(function(){
    $('#edit_image_dialog').load('actions.php?action=edit_temp_image', function(){
            $('#edit_image_dialog').dialog({
                modal: true,
                resizable: false,
                width: 480,
                    buttons: {
            Ok: function() {
                        //foo_bar                                                                        
            },
                        Cancel: function() {
                        //foo_bar
            }
                    },
                    beforeclose: function(){
                    //What should i put here ???
                    ;}
            });
    initialize_selection();
        });
    });
});

我真的很感激一些提示,因为我是jquery的新手,我无法工作我自己出去。

I would really appreciate some tips, because i'm new to jquery and I can't work this out by myself.

谢谢

推荐答案

http://odyniec.net/projects/imgareaselect/usage.html

$('#image_area').imgAreaSelect({remove:true});

应该有效,但不确定

这篇关于从元素中删除jquery imgareaselect插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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