Snippet Support

Modifications maintained and supported by 4seven
Forum rules
This forum is moderated by 4seven!
User avatar
4seven Offline
BBCoder III
BBCoder III
Posts: 124
Joined: 11 Mar 2010, 17:43
Last active: -

Snippet Support

Post by 4seven »

Snippet Support
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
4seven Offline
BBCoder III
BBCoder III
Posts: 124
Joined: 11 Mar 2010, 17:43
Last active: -

Snippet Support

Post by 4seven »

Adding Background image to textarea

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
User avatar
4seven Offline
BBCoder III
BBCoder III
Posts: 124
Joined: 11 Mar 2010, 17:43
Last active: -

Snippet Support

Post by 4seven »

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;"
Replace with

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
User avatar
Martin_K Offline
BBCoder III
BBCoder III
Posts: 121
Joined: 02 Sep 2011, 09:13
Last active: -
Favourite BBCode: textarea
Favourite EXT: Newsletter Add on
Location: London, UK

Snippet Support

Post by Martin_K »

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?
User avatar
Martin_K Offline
BBCoder III
BBCoder III
Posts: 121
Joined: 02 Sep 2011, 09:13
Last active: -
Favourite BBCode: textarea
Favourite EXT: Newsletter Add on
Location: London, UK

Snippet Support

Post by Martin_K »

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.
User avatar
4seven Offline
BBCoder III
BBCoder III
Posts: 124
Joined: 11 Mar 2010, 17:43
Last active: -

Snippet Support

Post by 4seven »

I check it out and call back ;)
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
4seven Offline
BBCoder III
BBCoder III
Posts: 124
Joined: 11 Mar 2010, 17:43
Last active: -

Snippet Support

Post by 4seven »

Simply a little change:

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;"
Replace with

Code: Select all

    name="message" id="message" style="background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;" onmouseover="this.style.background='#FFFFFF';"
Tested. If you want to make it work another way, explain exactly what you want..
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
martin123456 Offline
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 11:29
Last active: -
Favourite EXT: Ban button
Location: Down south!

Snippet Support

Post by martin123456 »

And for quickreply_editor.html

Code: Select all

<textarea style="height: 20em; background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;"
Replace with

Code: Select all

<textarea style="height: 20em; background: #FFFFFF url('{ROOT_PATH}images/message.png') center no-repeat;"onmouseover="this.style.background='#FFFFFF';"
Tested and works.
User avatar
Stoker Offline
Site Admin
Site Admin
Posts: 4,181
Joined: 12 May 2008, 21:26
Last active: -
Favourite EXT: Forum Goal
Location: Denmark

Snippet Support

Post by Stoker »

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.
~ The greatest achievement in life is to inspire ~
Regards Stoker
User avatar
martin123456 Offline
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 11:29
Last active: -
Favourite EXT: Ban button
Location: Down south!

Snippet Support

Post by martin123456 »

Best way is to use the css fade effect onmouseover wink wink