[web] Border respond to event

Started by
7 comments, last by Fuzztrek 19 years ago
Is there a way using &#106avascript &/| css to make a border of an element respond to a specific event, such as onmousedown, onmouseover events?
Advertisement
You can gain access to an object's style properties by using getElementById to return the object then .style to edit it.

In example...

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

Quote:Original post by benryves
You can gain access to an object's style properties by using getElementById to return the object then .style to edit it.

Yeah, I know:), but the thing is that i want a tableborder to respond to certain events and I have had no luck in implementing this.
Could you explain what exactly you're trying to implement? It seems an odd thing to have a table's border do anything besides display some lines.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Oh, do you mean you want to, say, call a function when someone clicks on a table's border (but not the entire table itself)? I don't think that's possible, currently, but an intersting concept.
Quote:Original post by Fuzztrek
Oh, do you mean you want to, say, call a function when someone clicks on a table's border (but not the entire table itself)? I don't think that's possible, currently, but an intersting concept.

Yeah, thats exactly what im trying to do. The user should be able to resize the table when clicking and dragging on its border.
As I said before, I don't think it's possible using conventional methods. However, you may be able to construct something similar using the entire table's events, and checking to see if the user's mouse coordinates are in the appropriate range on click (or something.) Also, if you are trying to create some sort of WYSIWYG editor, you can look into designMode (and its other incarnations on different browsers) which lets the user edit the entire HTML document (not just tables).
Ok. I have another question for you Fuzztrek:)

I'm trying to build a sort of window alike GUI using dom, css and &#106avascript. The problem is my CreateWindow function. All the windows should be appended inside the 'main document', the content area of each window is made up from an iframe.<br>The problem is - if i have have a icon inside the page loaded in the iframe of my first window and click this a second window should be appended into the main page, but instead it's created inside the iframes current document. So, is there some way to get the main pages object from a &#106avascript, i tried to use window.document without any good result:)
You should be able to use the "parent" object inside the iFrame to access the "main document". I'm not exactly sure about calling a user-defined function in another frame, as I haven't used frames very much. Some more information on iFrames can be found here, maybe it will provide some help ;)

This topic is closed to new replies.

Advertisement