How to do resizing square above the web page content

Discussion in 'HTML' started by Jon Berg, Jan 7, 2005.

  1. Jon Berg

    Jon Berg Guest

    I want to be able to create a square above the web page content.
    I want to be able to resize this square on the fly, not by reloading the
    page. It would be cool to be able to drag it by the mouse pointer,
    but I guess as a second best way buttons could be pressed to move and
    resize the square.
    I also want to be able to extract the coordinates of this square.

    This is going to be used to select a section of a web page. Sort of the
    same way you can select icons on the windows desktop.

    Does anybody have any ideas or know of a way to this?
    Is it possible to use a layer?
    Do anybody know of some page where something like this is done?

    Jon Berg.
    Jon Berg, Jan 7, 2005
    1. Advertisements

  2. You can put a transparent fixed-position object using CSS. I suppose you
    meant 'over' and not 'above'
    That's where you get a bit greedy. You'll probably need to involve some
    programming to do this.
    For all these key and mouse events you'll need callbacks. There are some
    demos at JavaScript Source, which provide a good starting point.
    I don't think you will be able to do this. You over-estimate the
    functionality of browsers. If you managed to do it, it probably would not
    be valid and only work in one particular browser.
    Go and see WYSIWYG Pro ( which
    does some of the things you are after. It's pure JS, IIRC. Not free
    Roy Schestowitz, Jan 8, 2005
    1. Advertisements

  3. Jon Berg

    Toby Inkster Guest

    Tested in Opera 7.5x, IE 6 and Mozilla 1.6. Works in Opera 7.5x, but not
    the others -- don't know why.
    Toby Inkster, Jan 8, 2005
  4. Confirmed not working in Mozilla Firefox1.0 either. The code looks quite
    elegant though...
    Roy Schestowitz, Jan 8, 2005
  5. Jon Berg

    Jon Berg Guest

    That is the sort of thing I meant exactly. It is very great, but a bit
    bad that it only works in Opera. The red square seems to pop up in
    Mozilla, but that's all.

    Anybody have any idea how this can be fixed so it would work in Mozilla.

    Anyway thanks.

    Jon Berg, Jan 8, 2005
  6. Jon Berg

    Jon Berg Guest

    Yes the resizing of the elements shows something like what I want to
    accomplish. And it works great in Mozilla. I looked through the source
    code of the html editor, but it was not apparent to me where the actual
    code that does that fancy resize thing. It will be difficult to get an
    idea of how they do that.

    Jon Berg, Jan 8, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.