Js pretty special effects Image vibration effect code

Source: Internet
Author: User
Tip: you can modify some code before running

<style>.shakeimage{position:relative}</style><script language="JavaScript">Var rector = 3var stopit = 0 var a = 1 function init (which) {stopit = 0 shake = whichshake. style. left = 0shake. style. top = 0} function rattleimage () {if ((! Document. all &&! Document. getElementById) | stopit = 1) returnif (a = 1) {shake. style. top = parseInt (shake. style. top) + rector} else if (a = 2) {shake. style. left = parseInt (shake. style. left) + rector} else if (a = 3) {shake. style. top = parseInt (shake. style. top)-rector} else {shake. style. left = parseInt (shake. style. left)-rector} if (a <4) a ++ elsea = 1 setTimeout ("rattleimage ()", 50)} function stoprattle (which) {stopit = 1which. style. left = 0which. style. top = 0}</script>
Tip: you can modify some code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.