03laceys Posted February 17, 2009 Posted February 17, 2009 Thanks to a little help from killah i finally managed to make clickable smilies... <input type="image" src="/smilies/smiley14.gif" alt="smile" title="smile" onclick="insert(this.form.message,':horny'); return false;" /> But now i am trying to so the same but with BBcode the snag i am running into is... This code inserts the code but does not do the mouseover... <input type="image" src="/icons/bold.gif" name="NAME" alt="Bold" title="Bold" onmouseover="document.NAME.src='/icons/bold_on.gif'" onmouseout ="document.NAME.src='/icons/bold.gif'" onclick="insert(this.form.message,'[b][/b]'); return false;" /> This code does the mouseover but dosn't insert the code... [img=/icons/bold.gif] How can i make it do both? Quote
Haunted Dawg Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. Make it a class <input type="button" class="bbcode_hover" onClick="insert(this.form.message,'[b][/b]'); return false;" value="" /> As for your CSS .bbcode_hover { background-image: url('/icons/bold.gif'); height: 10px; width: 10px; } .bbcode_hover:hover { background-image: url('/icons/bold_on.gif'); height: 10px; width: 10px; } Quote
Dave Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. Correct me if im wrong but :hover dosen't work in IE (Except links) Quote
Haunted Dawg Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. It work's on TD's so i am sure it should work on button's ;) Quote
Dave Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. Okie thanks for the info :mrgreen: Quote
Haunted Dawg Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. Hmm.. seem's you are correct there. It doesn't work on IE. <head> <style> .bbcode_hover { background-image: url('http://www.hitmanslegacy.co.uk/icons/bold.gif'); background-color: transparent; height: 20px; width: 20px; border: 0px; } .bbcode_hover:hover { background-image: url('http://www.hitmanslegacy.co.uk/icons/bold_on.gif'); background-color: transparent; height: 20px; width: 20px; border: 0px; } </style> </head> <body> <input type="button" class="bbcode_hover" onClick="insert(this.form.message,'[b][/b]'); return false;" value="" /> </body> Quote
Dave Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. xD. I thought it wouldn't after doing mouse over's on iamwicked.net, i used [*]'s in the end i think. Quote
03laceys Posted February 17, 2009 Author Posted February 17, 2009 Re: Clickable images with mouseover. In that case that idea's no good killah. :oops: Quote
Haunted Dawg Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. This here look's interesting to read. http://www.xs4all.nl/~peterned/csshover.html Quote
03laceys Posted February 17, 2009 Author Posted February 17, 2009 Re: Clickable images with mouseover. Looks like it will work worth a try, thanks killah. Quote
03laceys Posted February 17, 2009 Author Posted February 17, 2009 Re: Clickable images with mouseover. Link whatever:hover to the body element, and you're all set. Note that behavior URLs are relative to the html file, not to the CSS file like a background image URL would be. body { behavior: url("csshover3.htc"); } So do i need to download a file? Quote
03laceys Posted February 17, 2009 Author Posted February 17, 2009 Re: Clickable images with mouseover. Iv'e done it.. Quote
Dave Posted February 17, 2009 Posted February 17, 2009 Re: Clickable images with mouseover. If you use that your CSS will become invalid via the W3 Testing thingy. Quote
AlabamaHit Posted February 18, 2009 Posted February 18, 2009 Re: Clickable images with mouseover. Does it stay focus on the text area? lol Quote
03laceys Posted February 18, 2009 Author Posted February 18, 2009 Re: Clickable images with mouseover. Does it stay focus on the text area? lol stay focused? Quote
BlueDevil23 Posted February 19, 2009 Posted February 19, 2009 Re: Clickable images with mouseover. Also look into Suckerfish:hover, less code, and less complicated than, Whatever:hover. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.