Snippet Support
Forum rules
This forum is moderated by 4seven!
This forum is moderated by 4seven!
Snippet Support
Adding Background image to textarea
Post by Martin_K
Post by Martin_K
Is there any way of having the background image disappear when inputting text?
Current Mods | Mod Base | php(BB) programming | No help via PM
Snippet Support
Open
styles/prosilver/template/posting_editor.html
Find
Replace with
styles/prosilver/template/posting_editor.html
Find
Code: Select all
name="message" id="message" style="background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;"
Code: Select all
name="message" id="message" style="background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;" onmouseover="this.style.backgroundColor='#FFFFFF';"
Current Mods | Mod Base | php(BB) programming | No help via PM
- Martin_K
- BBCoder III
- Posts: 121
- Joined: 02 Sep 2011, 11:13
- BBCodes: 10
- Favourite BBCode: textarea
- Favourite MOD: Newsletter Add on
- Location: London, UK
- Contact:
Snippet Support
Can't get this to work. Is there a way to do this with css, hover and focus, over the whole text box, and not just the image?
- Martin_K
- BBCoder III
- Posts: 121
- Joined: 02 Sep 2011, 11:13
- BBCodes: 10
- Favourite BBCode: textarea
- Favourite MOD: Newsletter Add on
- Location: London, UK
- Contact:
Snippet Support
I have nearly got it working the way I want by using the input[type=text] css attribute selector, so when you click in the box to start typing the background can be made to disappear. Thanks for your efforts.
Snippet Support
I check it out and call back
Current Mods | Mod Base | php(BB) programming | No help via PM
Snippet Support
Simply a little change:
Open
styles/prosilver/template/posting_editor.html
Find
Replace with
Tested. If you want to make it work another way, explain exactly what you want..
Open
styles/prosilver/template/posting_editor.html
Find
Code: Select all
name="message" id="message" style="background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;"
Code: Select all
name="message" id="message" style="background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;" onmouseover="this.style.background='#FFFFFF';"
Current Mods | Mod Base | php(BB) programming | No help via PM
- martin123456
- BBCoder VI
- Posts: 765
- Joined: 25 Jul 2011, 13:29
- BBCodes: 34
- Favourite MOD: Ban button
- Location: Down south!
- Contact:
Snippet Support
And for quickreply_editor.html
Replace with
Tested and works.
Code: Select all
<textarea style="height: 20em; background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;"
Code: Select all
<textarea style="height: 20em; background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;"onmouseover="this.style.background='#FFFFFF';"
- Stoker
- Site Admin
- Posts: 3536
- Joined: 12 May 2008, 23:26
- BBCodes: 239
- Favourite BBCode: Anipro
- Favourite MOD: PrettyPhoto
- Location: Denmark
- Contact:
Snippet Support
I suggest you use onfocus instead og onmouseover.
Downside with both solutions is that the bg image isnt reinstated when focus is out.
Maybe we should look at the way the search bar works.
Downside with both solutions is that the bg image isnt reinstated when focus is out.
Maybe we should look at the way the search bar works.
Board rules! No PM support
- martin123456
- BBCoder VI
- Posts: 765
- Joined: 25 Jul 2011, 13:29
- BBCodes: 34
- Favourite MOD: Ban button
- Location: Down south!
- Contact:
Snippet Support
Best way is to use the css fade effect onmouseover wink wink