jQuery可调整大小的插件:使用哪个句柄? [英] jQuery's resizable plugin: Which handle is used?

查看:57
本文介绍了jQuery可调整大小的插件:使用哪个句柄?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能否请您告诉我如何知道使用哪个句柄(n,e,s或w)来调整元素的大小?

Could you please tell me how to know which of the handles (n, e, s, or w) is used to resized an element?

推荐答案

主题很旧,但我一直在寻找相同的答案并找到了这种方法.

topic is old but I was looking for the same answer and found this method.

    var handleTarget; //set scope

    $('#resize-this').resizable({
      handles: 'n,e,s,w',

      start: function(ui,event){
        handleTarget = $(event.originalEvent.target);
      },

      resize: function(ui,event){
        if (handleTarget.hasClass('ui-resizable-s'){
           //do stuff
        }
      } 
    )}; 

这篇关于jQuery可调整大小的插件:使用哪个句柄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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