This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreScript Title: tweenWidthTo
Programming Language: Java Script
Date Completed: 2013/04/07
Purpose: To animate the changing width of an HTML Element.
Description: Changes the width of an HTML Element by animating the width change. Note: method will not start if the targetId or targetSize is not set or the input is not valid.
Methods:
var class = new tweenWidthTo();
class.targetId
Set to select a HTML Element by ID to be sized. *Required
class.targetSize
Set the amount of the new height measured in pixels. Takes a number value. *Required
class.pixelRate
Set the amount of pixels to change the size of the element each interval. Takes a positive or negative number. Determines whether to make larger or smaller. Default value 5.
class.intervals
Set the interval rate measured in milliseconds. Default value 16.
class.start()
Function to start the resizing animation.
class.stop()
Function to stop the resizing animation, sets the element size to the target size.
class.pause()
Function to pause the resizing animation.
class.isActive()
Function to determine if the resizing animation is active. Returns true or false.
Example Usage:
var sizeBox1 = new tweenWidthTo();
sizeBox1.targetId = “box”;
sizeBox1.targetSize = 60;
sizeBox1.pixelRate = -5;
sizeBox1.intervals = 8;
sizeBox1.start();
This example decreases the size of element ID box to the size of 60 by 5 pixels every 8 milliseconds (125 frames per second)
Terms of Use, Cookies, Privacy, and more, see Terms and Privacy
Third-party copyrights and trademarks featured on this site are owned by their respected holders.
Website written and designed by Patcoola 2019, some rights reserved.
This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear EU visitor, I am required to ask you consent for the following.