jQuery UI Shake Effect - jQuery UI Tutorial 32

preview_player
Показать описание
Notes for You:: jQuery UI Shake Effect - jQuery UI Tutorial 32
- shakes an HTML element for a given number of times, vertically or horizontally

Options:
times (default: 3)
- indicates the number of times an HTML element should shake
- possible values: any integer number

distance (default: 20)
- indicates the distance an HTML element should cover
- possible values: any integer number

direction (default: "left")
- indicates the direction in which an HTML element should move initially
- possible values: left, right, up, down
- "left" or "right" indicates shake horizontally
- "up" or "down” indicates shake vertically.

mode (default: "effect")
- indicates whether to hide, show or just apply the effect to an HTML element
- possible values: hide, show, effect

1. Create a new HTML document with basic HTML document structure code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Shake Effect</title>
</head>
<body>
</body>
</html>

2. Link the necessary jQueryUI libray files to the HTML document

3. Create HTML element:
<p id="firstp">It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using LoremIpsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use LoremIpsum as their default model text, and a search for 'loremipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>

4. Select the HTML element using jQuery selector, call jQuery UI effect function on it

<script type="text/javascript">

$("#firstp").effect("shake",{times:3,distance:10,direction:"left", mode:"hide"}, 4000 , function(){
$("#firstp").delay(2000);
$("#firstp").effect("shake",{times:3,distance:10,direction:"up", mode:"show"}, 4000);
});

</script>

Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.

=========================================

Follow the link for previous video:
jQueryUI Tutorial 31 - jQueryUI Scale Animation Effect

=========================================
Рекомендации по теме
join shbcf.ru