导航:首页 > 编程语言 > 展开收缩代码

展开收缩代码

发布时间:2024-11-15 13:37:28

A. 利用VB实现窗体的展开与收缩

窗体上放一TIMER控件,Interval属性为200
双击窗体写上以下代码,就和QQ的一样效果啦!

Option Explicit

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
X As Long
Y As Long
End Type

Private Const HWND_TOPMOST = -1
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const HWND_TOP = 0
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40

Private Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub

Private Sub Timer1_Timer()
Dim p As POINTAPI
Dim f As RECT
GetCursorPos p
GetWindowRect Me.hwnd, f
If Me.WindowState <> 1 Then
If p.X > f.Left And p.X < f.Right And p.Y > f.Top And p.Y < f.Bottom Then
If Me.Top < 0 Then
Me.Top = -10
Me.Show
ElseIf Me.Left < 0 Then
Me.Left = -10
Me.Show
ElseIf Me.Left + Me.Width >= Screen.Width Then
Me.Left = Screen.Width - Me.Width + 10
Me.Show
End If

Else
If f.Top <= 4 Then
Me.Top = 40 - Me.Height
ElseIf f.Left <= 4 Then
Me.Left = 40 - Me.Width
ElseIf Me.Left + Me.Width >= Screen.Width - 4 Then
Me.Left = Screen.Width - 40
End If
End If
End If

End Sub

B. 如何用HTML、CSS3和javaScript做出下图的展开、收起的动画

这样就是一个展开收缩的效版果了权
<body>
<div id="div1">
<ul>
<li></li>
</ul>
</div>
<script>
var oDiv = document.getElementById('div1');
var oUl = oDiv.getElementsByTagName('ul')[0];
var Off = true;
oDiv.onclick = function(){
if(Off){
oUl.style.display = "block";
Off = false;
}else{
oUl.style.display = "none";
Off = true;
}
}
</script>

C. CSS收缩展开代码

要用javascript的<div><a href="javascript:vod(0);>"<B id="show_hide">收缩</B></a></div>
<ul id="content">
<li>收缩展开的内容一</li>
<li>收缩展开的内容二专</li>
<li>收缩展开的内容三属</li>
</ul>
<script>
document.getElementById('show_hide').onclick = function (){
var con = document.getElementById('content').style;
if(this.innerHTML == '收缩'){
con.display = 'none';
this.innerHTML = '展开';
return false;
} else {
con.display = '';
this.innerHTML = '收缩';
return false;
}
}
</script>

D. asp收缩栏,也就是展开栏,当点击一下的时候就展开子菜单,再点击一下的时候就收缩隐藏起来大虾们帮帮忙

<SCRIPT language=javascript1.2>
function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
}
}
</SCRIPT>
</head>

<BODY leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<table cellpadding=0 cellspacing=0 width=158 align=left>
<tr>
<td height=25 align="left" background="../images/Admin_left_3.gif" class=menu_title id=menuTitle4 style="cursor:hand;" onclick="showsubmenu(4)" onmouseover=this.className='menu_title2'; onmouseout=this.className='menu_title';>
<span>电影管理设置</span>←</td>
</tr>
<tr>
<td style="display: none" id='submenu4'>
<div class=sec_menu style="width:158">
<table cellpadding=0 cellspacing=0 align=left width=130>
<tr><td height=20><a href=../1.asp>1电影详细设置</a></td></tr>
<tr><td height=20><a href=../2.asp>2电影详细修改</a></td></tr>
<tr><td height=20><a href=../3.asp>3电影详细管理</a></td></tr>
<tr><td height=20><a href=../4.asp>4</a></td></tr>
<tr><td height=20><a href=../5.asp>5</a></td></tr>
</table>

好了··

E. android,点击右侧向下箭头后向下展开,点击展开后的空白又收缩了,这个功能怎么实现啊

很简单,一开始设置下面的textview不显示,即 android:visibility="gone",设置右边的图片按钮的图片为向上。
设置箭头按钮的点击事件。点击后,设置下面的textview显示,箭头图片变为向下。
当然来回显示,你还得加上一个全局变量,来判断当前显示的状态。首要状态还是现实效果。
不会再问我

阅读全文

与展开收缩代码相关的资料

热点内容
ps入门必备文件 浏览:348
以前的相亲网站怎么没有了 浏览:15
苹果6耳机听歌有滋滋声 浏览:768
怎么彻底删除linux文件 浏览:379
编程中字体的颜色是什么意思 浏览:534
网站关键词多少个字符 浏览:917
汇川am系列用什么编程 浏览:41
笔记本win10我的电脑在哪里打开摄像头 浏览:827
医院单位基本工资去哪个app查询 浏览:18
css源码应该用什么文件 浏览:915
编程ts是什么意思呢 浏览:509
c盘cad占用空间的文件 浏览:89
不锈钢大小头模具如何编程 浏览:972
什么格式的配置文件比较主流 浏览:984
增加目录word 浏览:5
提取不相邻两列数据如何做图表 浏览:45
r9s支持的网络制式 浏览:633
什么是提交事务的编程 浏览:237
win10打字卡住 浏览:774
linux普通用户关机 浏览:114

友情链接