If you want some parts of your blog page to attract the attention of readers, you can shake these parts, such as advertisements. Today this article will introduce how to shake the elements on your page. To achieve this goal, we need to use Jquery and Jquery UI. First, let me create a vibration block, which can be an image or a common dom element, such as div and span. Name the element id as shake, which can be any name here. We use the image below: [html] Jquery UI does not have a ready-made method to shake elements, we need to use the effect method to achieve, syntax: [javascript] effect ('shake ', options, speed); Parameter options (three parameters are available here): times: specifies the number of element vibrations distance: specify the Element Vibration Amplitude ction: Specify the vibration direction of the element. The following is the specific implementation method. Set the vibration to three times and call the vibration every MS: [javascript] function interval () {$ ('# shake '). effect ('shake ', {times: 3}, 100) ;}$ (document ). ready (function () {Var shake = setInterval (interval, 500 );}); before that, you need to introduce Jquery and Jquery UI [html] <script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"> </script> <script src = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"> </script> here I introduced the latest version. The complete code [html]