Skip to content

Instantly share code, notes, and snippets.

@pafnuty
Created January 26, 2013 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pafnuty/4644023 to your computer and use it in GitHub Desktop.
Save pafnuty/4644023 to your computer and use it in GitHub Desktop.
Ртололо
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Трололо</title>
<style>
body {
width: 720px;
margin: 0 auto;
padding: 50px 0;
}
.elem {
display: inline-block;
padding: 5px;
border: solid 1px #ccc;
margin: 0 5px 5px 0;
cursor: pointer;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script>
jQuery(document).ready(function($) {
console.log('готово');
$('body').on('click', '.elem:last', function () {
// $(this).after('<span class="elem">клик</span>');
setTimeout($(this).after('<span class="elem">клик</span>') $(this).next().trigger('click'), 1000);
console.log('клик');
})
});
</script>
</head>
<body>
<span class="elem">клик</span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment