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顯示,箭頭圖片變為向下。
當然來回顯示,你還得加上一個全局變數,來判斷當前顯示的狀態。首要狀態還是現實效果。
不會再問我