javascript - Variable does not work with alsoResize: -


i got code, wich works fine, until change '.1' colselect. guess because gets value late , when want use colselect havent registerd. have ideas on how solve this?

$(document).ready(function() {          var colselect;          $('.test2').mousedown( function(){                   colselect = '.' + $(this).attr('id');         });          $( '#1' ).resizable(         {handles:'e'},         {alsoresize: '.1'} // <- here change '.1' colselect         ); }); 

updated:

$(document).ready(function() {      var colselect;     $('#one').on('mouseover' ,mousedwn);   function mousedwn(){     colselect = '.' + $(this).attr('id');     resize(colselect);   } $('#one').on('mouseout' ,function(){     $('#one').off('mouseover' ,mousedwn); //prevent memory leaks });    });  function resize(para){   $( '#1' ).resizable(     {handles:'e'},     {alsoresize: para}      );   } 

working fiddle


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -