For more flexibility you may want to bind the mousemove and mouseup
functions to the document.

- Richard

On Tue, Dec 16, 2008 at 7:49 PM, Kean <shenan...@gmail.com> wrote:

>
> Hi Nejo31,
>
> I am too lazy to code, so I will mainly pseudo code.
>
> var initx;
> var inity;
> var resize = function(e){
>    created.height(e.pageY - initY);
>    created.width(e.pageY - initY);
>  };
>
> $("calendar container id").mousedown(function(e){
>  $("body").append('<div id="created"></div>');
>  initx = e.pageX;
>  inity = e.pageY;
>  var created = $("#created");
>
>  created.css({
>    position: 'absolute',
>    top:initY,
>    left: initX
>  });
>
>  $("#created").bind("mousemove", resize);
> });
>
> $("calendar container id").mouseup(function(e){
>  $("#created").unbind("mousemove", resize);
> });
>
> Many work has to be done to get it right, but here's the basic idea.
>
> On Dec 16, 3:01 pm, Nejo31 <nejc.pa...@gmail.com> wrote:
> > Hi,
> >
> > i have a question on what function to use to create a funciton to
> > create a div by clicking somewhere on the parrent div and dragging
> > down to determine the div size.
> >
> > To give you a better idea of what i mean here is a link of the DHTML
> > week planner demo.
> >
> > http://www.dhtmlgoodies.com/scripts/dhtmlgoodies-week-planner/dhtmlgo...
> >
> > You will see that you can create a new event in the planner by
> > clicking anywhere and dragging your mouse down. I am working on a
> > simmilar project and any on this subject help would be greatly
> > appreciated.
> >
> > Thanks.
> >
> > N.
>

Reply via email to