sudarshana
sudarshana

Reputation: 11

increase the width

how to increase the width of the line when mouse is moved where the line is drawn from canvas and its not an image and the line should increase or decrease gradually along with the mouse... well i will explain in brief.i have created a div with a line drawn in it and once when the mouse is moved over the line and futher moved forward the line should move along with the mouse pointer so that the width of the line should gradually increase and decrease as the mouse moves

thx in advance

Upvotes: 1

Views: 227

Answers (2)

x2.
x2.

Reputation: 9668

<div id="line" 
style="width:200px; background-color:#ccc;" 
onMouseOver="this.style.width='500px';" 
onMouseOut="this.style.width='200px';">
    &nbsp;
</div>

Upvotes: 0

Pranay Rana
Pranay Rana

Reputation: 176956

 document.getElementById("element").style.width = w;

Upvotes: 1

Related Questions