无法添加某些动画或向上滑动 [英] Unable to add some animation or slide up
本文介绍了无法添加某些动画或向上滑动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我想在单击标签的同时添加一些动画或一些幻灯片或在代码中滑动我.请您帮我一下.
我将分享我的运行代码.
Hi
i want to add some animation or some slide up or slide in my code while clicking on the label.can you please help me.
I will share my running code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi" />
<!--title>Expand table rows with jQuery - jExpand plugin - JankoAtWarpSpeed demos</title-->
<!--script src="jquery.collapser.min.js" type="text/javascript"></script-->
<style type="text/css">
.hidden {
visibility: hidden
}
</style>
<script src="jquery.min.js" type="text/javascript"></script>
<!--script src="jquery.collapser.js" type="text/javascript"></script-->
<script type="text/javascript">
/*$('.label').onClick( make_visible );
make_visible () {
var id = this.id;
id += '_desc';
$('.description').addClass('hidden'); //makes everything hidden again
$('#'+id).removeClass('hidden'); //nunhides the selected label description.
};*/
$(document).ready(function () {
$(".label").click(function () {
var id = this.id;
// $('.' + id).slideUp();
id += '_desc';
$('.description').addClass('hidden'); //makes everything hidden again
$('#' + id).removeClass('hidden'); //nunhides the selected label description.
});
});
</script>
</head>
<body>
<div id='label_xx1' class='label'> Label 1</div><div id='label_xx1_desc' class='description hidden'>Description 1</div>
<div id='label_xx2' class='label'>Label 2</div><div id='label_xx2_desc' class='description hidden'>Description 2</div>
<div id='label_xx3' class='label'>Label 3</div><div id='label_xx3_desc' class='description hidden'>Description 3</div>
<div id='label_xx4' class='label'>Label 4</div><div id='label_xx4_desc' class='description hidden'>Description 4</div>
</body>
</html>
谢谢
thanks
推荐答案
('.label').onClick(make_visible); make_visible(){ var id = this.id; id + ='_desc';
('.label').onClick( make_visible ); make_visible () { var id = this.id; id += '_desc';
('.description').addClass('hidden'); //再次将所有内容隐藏起来
('.description').addClass('hidden'); //makes everything hidden again
('#'+ id).removeClass('hidden'); //取消隐藏所选标签说明. }; */
('#'+id).removeClass('hidden'); //nunhides the selected label description. };*/
这篇关于无法添加某些动画或向上滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文