| Author |
Message |
pagespec
Joined: 14 Mar 2006 Posts: 5
|
| Posted: Tue Mar 14, 2006 - 10:55 pm Post subject: Textarea border |
|
|
I have a widget that is pretty basic. I have a single background image and I would like to place a textare on top of that image. I actually have that part working. My problem is that I would like the textarea to be unnoticeable except for the text within, of course. I am using css to hide the border of the textarea, but it is still visible and when you click on the textarea the border becomes highlighted making it even more obvious.
TIA
Paul |
|
| |
|
| |
jonbrown
Joined: 01 Jul 2005 Posts: 56 Location: USA
|
|
| |
|
| |
purvisa
Joined: 21 Jul 2005 Posts: 182 Location: Kirkland, WA
|
| Posted: Wed Mar 15, 2006 - 8:56 am Post subject: |
|
|
Have you looked at Apple's method for creating custom menus? The coder places a custom glass menu image down and a visibility 0 menu over it (the real one). Between the two is a DIV that displays custom-formatted info from the real (invisible) menu. Now, you could apply this sort of thing here with an onChange() event handler. The problem is that the onChange() may not kick in with each character.
This may just be a bad hack, but it might be fun to look into. I am too tired right now to make sense. |
|
| |
|
| |
pagespec
Joined: 14 Mar 2006 Posts: 5
|
| Posted: Wed Mar 15, 2006 - 11:47 pm Post subject: |
|
|
| The textarea is a read only control. I am populating it with data from a website. |
|
| |
|
| |
jonbrown
Joined: 01 Jul 2005 Posts: 56 Location: USA
|
| Posted: Thu Mar 16, 2006 - 1:04 am Post subject: Masking |
|
|
| In that case u can use an image mask over the text area the image will be on a layer over the text area and the area u want to be shown will be of course transparent, and the areas u want hidden will be white or what ever color or pattern your widget is. A good example of this is the Anniversary Wedding Guide Widget. |
|
| |
|
| |
pagespec
Joined: 14 Mar 2006 Posts: 5
|
| Posted: Thu Mar 16, 2006 - 9:49 am Post subject: |
|
|
| Thanks for the advice. I will give it a go. |
|
| |
|
| |
gnome Administrator

Joined: 26 Sep 2004 Posts: 145
|
| Posted: Fri Mar 17, 2006 - 12:56 am Post subject: |
|
|
I don't think you want to do it that way; in fact, I don't think you're looking for a textarea at all. I think a much simpler solution to your problem is to use a <div> tag. If you give the div tag an ID, you can reference the div through document.getElementById('whatever_the_id_is').whateverYouWantToDo;. Then in order to change the contents of the div, use the .innerHTML property.
In your case, your code would probably look something like this:
| Code: | <script>
function websiteHasLoadedSoNowDisplayTheBody() {
document.getElementById('websitetext').innerHTML = yourXMLHttpRequestObject.responseText;
}
//all your XmlHttpRequest junk here...
</script>
<div id="websitetext" style="width: 250px; height: 150px">Loading Whatever It Is This Widget Does...</div> |
Mucking around with image masks and overlaying the positioning is, sorry, but it's completely the wrong way to go. (Clean code is happy code. )
P.S. Notice I gave the <div> tag style information to set the width and height. Adjust these according to your widget. |
|
| |
|
| |
jonbrown
Joined: 01 Jul 2005 Posts: 56 Location: USA
|
| Posted: Fri Mar 17, 2006 - 9:00 am Post subject: this is good |
|
|
This is good thanks, for the code, yes simpler is better. Code on |
|
| |
|
| |
pagespec
Joined: 14 Mar 2006 Posts: 5
|
| Posted: Tue Mar 21, 2006 - 9:43 pm Post subject: |
|
|
I have a question based on the <div> solution. I currenetly have a working Konfabulator widget that populates a text area with a text file that it pulls off of the Internat. I would like to use the same text file to populate this widget. I only have to write the widget once, but the text has to be maintained throughout the year. It would be simpler to have one file for both widgets.
The text file has no formatting in it other than some line feeds and that does not work very well when inserted into te <div> tag. Still looking for ideas though. |
|
| |
|
| |
pagespec
Joined: 14 Mar 2006 Posts: 5
|
| Posted: Wed Mar 22, 2006 - 12:39 am Post subject: |
|
|
I got all of my problems figured out.
I was able to use the textarea and setting it to "disabled" made it unselectable, but you can still scroll through the contents.
Thanks for all of your suggestions.
Paul |
|
| |
|
| |