p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   Using '+=' with the fontSize attribute (http://p2p.wrox.com/showthread.php?t=27674)

interrupt April 4th, 2005 10:45 AM

Using '+=' with the fontSize attribute
Hi all,

Here is my script:

function moving2(){
movethis.style.fontSize+= 0.2
moveid2=setTimeout("moving2()", 20)}

The font size won't increase though, any ideas? If I comment it out though the layer will move quite happily. I'm trying to grow the text as it moves.


Hatchingabrain April 6th, 2005 06:53 AM

var a=""
var c="what-ever you want to say!"
for (i=0,i<7,i++)
document.write (a + '"+' + i + '">' + c + b)

hope this helps...

vinod_yadav1919 April 6th, 2005 06:58 AM

Hii Interrupt!!
 With parseInt
Following is working fine
<DIV ID="movethis" STYLE="position:absolute; width:auto; height:auto; left:20px;
top:50px; background-color:white;font-size:2">hello</div>
<input type=button name=vin1 value="moveit" onclick="moving2()" >
function moving2(){
movethis.style.pixelLeft=parseInt(movethis.style.p ixelLeft)+5
movethis.style.fontSize=parseInt(movethis.style.fo ntSize)+1
moveid2=setTimeout("moving2()", 20)}

Hope this will hep you

Cheers :)


All times are GMT -4. The time now is 07:31 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.