473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Nov 4 '05 #1
1 1701
Rob
jeffg wrote:
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


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.

Nov 4 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Christopher | last post by:
This should be a quick one. URL: http://cfa-www.harvard.edu/~cpilman/Stuff/flush.html Code: ============================= <!DOCTYPE HTML Public "-//W3C//DTD HTML 4.01//EN">...
14
by: Florian Brucker | last post by:
Hi! Here's what it should look like: <style type="text/css"> span.h1 { border-style:solid; border-width:0px; border-color:#000000; border-bottom-width:2px;
1
by: Jon W | last post by:
This is a small table with hover on the table cells. The first cell is setup to switch from div element to input element by use of display:block/none. In IE, onclick the input element is displayed...
4
by: andres obrero | last post by:
i want to resize dynamically table cols. But some strange behaviour occurs under mozilla. I cannot resize a col smaller than the largest element, even with overflow hidden and table-layout fixed....
2
by: jeffg | last post by:
I have a DIV that I'd like to let the users resize the width by dragging the right border. Is that possible, and if so, how? I'm guessing this sort of thing has been asked before, but all of my...
2
by: Stanimir Stamenkov | last post by:
I'm trying to clear some sizing issues relative to the initial containing block and the root document element. The sample document I'm trying with: http://stanio.info/viewport_fill.html ...
4
by: Dave | last post by:
TIA for the help.....this should be easy for a pro....I need the two divs with text to display on the same line at the top of the container..??? <html> <head> <style> body...
14
by: Mark Shroyer | last post by:
I just noticed an unintuitive aspect of how nested blocks are positioned under a specific set of conditions, and although this is ostensibly correct behavior (unless Firefox, Safari, and Opera are...
7
by: GTalbot | last post by:
Hello fellow authoring.stylesheets colleagues, Can someone please explain why the bottom margin of the last inflow block-level child in an overflowed parent should not have its margin reachable....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.