Ben Scmidth
Ben Scmidth

Reputation: 1335

Change buttons on mouseover and mouseout?

I have created this but no idea why was the code cus it's not workin, Can anyone spot a mistake? I want to create a button, it's called Calculator and once the mouse over, the button will change to Powered by X and back to Calculator when mouseout.

$(this).fadeIn(change,100);

Upvotes: 0

Views: 83

Answers (1)

Dhananjay Sakhare
Dhananjay Sakhare

Reputation: 494

use $('#calc_butt').html(change); instead of $(this).fadeIn(change,100);

Edit

I changed a method of doing it. Instead of using javascript i used css to achieve the desired output. Please let me know if it's helpful

<div id="toggleDiv">
<a href="xx" id="calculator">
 Calculator</h4>

<h4 id="poweredby">
Powered by!
</h4>

</a>

</div>


<style>
#poweredby{display:none}
div#toggleDiv h4#calculator {
display:inline;
}
div#toggleDiv:hover h4#calculator {
display:none;
}
div#toggleDiv h4#poweredby {
display:none;
}
div#toggleDiv:hover h4#poweredby {
display:inline;
}
</style>

Upvotes: 2

Related Questions