Div. The animate ({
Width: '0%',
Width: '100%'
})
I want to be executed multiple times from 0 100, not from 0 after 100, 100 to 0, and then the effect of from 0 to 100
Question 2
After the last animation effects from 0 to 100, I in order to achieve the 0 to 100, many times just after want to div width to 100 set to 0
Just wrote a div. CSS (' width ', '0%'); How does not work or
CodePudding user response:
<meta charset="utf-8"/& gt;
<meta name="viewport" content="width=device - width, initial - scale=1.0" & gt;
<meta HTTP - equiv="X - UA - Compatible" content="IE=edge, chrome=1"/& gt;
# div {
Height: 50 px;
background-color: #f00;
}
</style>
<body>
$(" # div "). The CSS ({
Width: '0%'
}). The animate ({
Width: '100%'
}, 2000, fun);
}
Fun ();
</script>