Click here to Skip to main content
15,070,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I add a label & assign the text property is 'Welcome label.' & font size is default.

After running the page when i locate the mouse onto label control, font of the text property is growing as setting maximum size & reversely, when lost the mouse from label, font of the text is set to default state.

I will i solve the above problem using java script, not jquery????
Please please help me anybody....
Posted
Comments
Zoltán Zörgő 8-Oct-12 9:09am
   
jquery is javascript.
Mohibur Rashid 8-Oct-12 9:15am
   
Keep your last style font in a variable, when mouse move out then set back the old font

Something like this one?
XML
<style>
#highlighter {
    width: 250px;
    height: 100px;
    border: 1px solid red;
    position: absolute;
    display: table;
    text-align: center;
}

#highlighter p {
    vertical-align: middle;
    display: table-cell;
}

.h_down p {
    font-size: 30px;
}

.h_up p {
    font-size: 50px;
}
</style>
<script>
function up(element) {
    element.className="h_up";
}

function down(element) {
    element.className="h_down";
}
</script>
<div id="highlighter" class="h_down" onmouseover="up(this);" onmouseout="down(this);"><p>let's see</p></div>
   
Changing font is done using CSS.

So, you should have a label:hover property in your CSS that change the font size or you have a hover event listener who is doing the same dynamically.

Check your label style using firebug.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900