/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] JavaScript animation not work on Mozila and Safari

[CODE]

<script>

var speed = 10; // Delay between increments.
var inc = 10; // Increment amount — also changes speed

function ScaleToFit(id) {
var obj= document.getElementById(id);
resize(obj.scrollHeight, 0, id);

var buttonObj= document.getElementById(‘hidden_button’);
buttonObj.style.visibility = “hidden”;
}

function resize(height, current, id) {

var obj = document.getElementById(id);
if (current <= height) {
i = current + inc;
obj.style.height = i;
}

if (current <= height) {
var t = window.setTimeout(“resize(“+height+”, “+i+”, ‘”+id+”‘)”, speed);
} else {
obj.style.height = height;
}

}
</script>

[/CODE]

I would like to know why this function not working with Mozila and Safari,

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 16.2010 — Give the heights unitsobj.style.height = foo[COLOR="Blue"] + "px"[/COLOR];
Copy linkTweet thisAlerts:
@ZivTalauthorAug 16.2010 — Give the heights unitsobj.style.height = foo[COLOR="Blue"] + "px"[/COLOR];[/QUOTE]

I already found it on another post.

But really thank you.
×

Success!

Help @ZivTal spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...