Jump to content
MakeWebGames

Recommended Posts

Posted

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?

Posted

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;
}
Posted

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>
Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...