aboutsummaryrefslogtreecommitdiffstats
path: root/demos/effect/addClass.html
blob: 09de613121c1177c05f49508f9a558e372f6d05a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>jQuery UI Effects - addClass demo</title>
	<link rel="stylesheet" href="../../themes/base/all.css">
	<link rel="stylesheet" href="../demos.css">
	<style>
		.toggler { width: 500px; height: 200px; position: relative; }
		#button { padding: .5em 1em; text-decoration: none; }
		#effect { width: 240px;  padding: 1em; border: 1px solid #000; background: #eee; color: #333; }
		.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 120px; padding: 30px; margin: 10px; font-size: 1.1em; }
	</style>
	<script src="../../external/requirejs/require.js"></script>
	<script src="../bootstrap.js">
		$( "#button" ).on( "click", function() {
			$( "#effect" ).addClass( "newClass", 1000, callback );
		});

		function callback() {
			setTimeout(function() {
				$( "#effect" ).removeClass( "newClass" );
			}, 1500 );
		}
	</script>
</head>
<body>

<div class="toggler">
	<div id="effect" class="ui-corner-all">
			Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede.
	</div>
</div>

<button id="button" class="ui-state-default ui-corner-all">Run Effect</button>

<div class="demo-description">
<p>This demo adds a class which animates: text-indent, letter-spacing, width, height, padding, margin, and font-size.</p>
</div>
</body>
</html>
class="p">( input ) { var msg = "Selected " + String.prototype.trim.call( input.data( "tooltip-title" ) || input.text() ); $( "<div>" ) .appendTo( document.body ) .text( msg ) .addClass( "notification ui-state-default ui-corner-bottom" ) .position({ my: "center top", at: "center top", of: window }) .show({ effect: "blind" }) .delay( 1000 ) .hide({ effect: "blind", duration: "slow" }, function() { $( this ).remove(); }); } $( "button" ).each(function() { var button = $( this ).button({ icons: { primary: $( this ).data( "icon" ) }, text: !!$( this ).attr( "title" ) }); button.not( ".menu" ).on( "click", function() { notify( button ); }); }); $( ".set" ).controlgroup({ items: { "button" : "button" } }); $( "button.menu" ) .on( "click", function() { $( document ).tooltip( "close", { currentTarget: this }); var menu = $( this ).next().show().position({ my: "left top", at: "left bottom", of: this }); $( document ).one( "click", function() { menu.hide(); }); return false; }) .next() .hide() .menu({ selected: function( event, ui ) { notify( ui.item ); } }); $( document ).tooltip({ position: { my: "center top", at: "center bottom+5", }, show: { duration: "fast" }, hide: { effect: "hide" } }); </script> </head> <body> <div class="player">Here Be Video (HTML5?)</div> <div class="tools"> <span class="set"> <button data-icon="ui-icon-circle-arrow-n" title="I like this">Like</button> <button data-icon="ui-icon-circle-arrow-s">I dislike this</button> </span> <div class="set"> <button data-icon="ui-icon-circle-plus" title="Add to Watch Later">Add to</button> <button class="menu" data-icon="ui-icon-triangle-1-s">Add to favorites or playlist</button> <ul> <li><div>Favorites</div></li> <li><div>Funnees</div></li> <li></li> <li><div>New playlist...</div></li> </ul> </div> <button title="Share this video">Share</button> <button data-icon="ui-icon-alert">Flag as inappropriate</button> </div> <div class="demo-description"> <p>A fake video player with like/share/stats button, each with a custom-styled tooltip.</p> </div> </body> </html>