javascript - jQueryUI Resizable alsoResize can't be passed $(this).next() -
when using jqueryui .resizable()
function, i'm trying cause next element in dom resized. can pass jquery selector, or string class or id alsoresize
method, can't pass $(this).next()
select next element in dom.
my code:
$(selector).resizable({ alsoresize:$(this).next() });
you can run fiddle here, , uncomment lines 67/68 see work/not work.
it's because this
referring document (you can see doing console.log(this)
). if change alsoresizereverse: $("#resizable").next()
should work you.
edit
you can this:
$.each($("#colors li"), function(index, value) { $(this).resizable({ alsoresize:$(this).next() }) });
Comments
Post a Comment