Connecting Tech Pros Worldwide Help | Site Map

dragging a block element border to resize

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 4th, 2005, 04:25 PM
jeffg
Guest
 
Posts: n/a
Default dragging a block element border to resize

I have a DIV that needs to give the user the ability to grab its right
border to resize the width of the block. I know that CSS supports
properties such as cursor : col-resize to provide the visual indication
that the element can be dragged with the mouse. But I cannot for the
life of me figure out how to make the event fire only when the pointer
is over the right border.

I've searched this group many times and can't find anything on this.
So, please, help. Any code snippets would be appreciated.

Jeffg


  #2  
Old November 4th, 2005, 07:15 PM
Rob
Guest
 
Posts: n/a
Default Re: dragging a block element border to resize

jeffg wrote:
[color=blue]
> I have a DIV that needs to give the user the ability to grab its right
> border to resize the width of the block. I know that CSS supports
> properties such as cursor : col-resize to provide the visual indication
> that the element can be dragged with the mouse. But I cannot for the
> life of me figure out how to make the event fire only when the pointer
> is over the right border.
>
> I've searched this group many times and can't find anything on this.
> So, please, help. Any code snippets would be appreciated.
>
> Jeffg[/color]

What I would probably do (and I'm no expert on this) is instead of relying
on the mouse to be over the said element, rely on the mouse being at a
certain location on the screen -- then on a left click event have the block
resize.

So get the location of the border. When the mouse hits that location trigger
an event.

I don't think it's possible to have CSS trigger a javascript event, hence
why I would go by pointer location.



 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.