1、網頁設計,如何製作在點擊一個按鈕之後,才在一個div框中顯示文字圖片
對按鈕添加個onclick事件就行了,下面是個案例。
<div id="box"></div>2、網頁設計中在頁面中加入個按鈕,在點擊按鈕的時候,頁面提示5次「hello Word」
這樣:
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function fun()
{
for (i=0; i<5; i++)
{
document.write("Hello World<br>");
}
}
</script>
</head>
<body>
<form action="">
<input type="submit" value="按鈕" onclick="fun()"/>
</form>
</body>
</html>
3、怎樣在設計網頁中點擊某個按鈕,執行某個事件?
給你段關閉網頁的代碼做參考吧 </table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E5F6FF">
<tr>
<td height="80" align="center" class="morew" style="padding-left:30px; padding-right:30px">[ <a href="#" onClick="window.close()"><font color="#000000">關 閉</font></a> ]</td>
</tr>
</table> 可以把它插到<body>和</body>之間試下。
4、網頁製作中怎麼做出點擊按鈕更換圖片的效果
更改圖片有兩個辦法
第一個是將所有圖片載入,但是只顯示一張圖片,其餘的隱藏,每點擊一次,將當前的隱藏,下一個顯示。
<div><!-- 這個div用了放置所有的img圖片 -->第二個是添加一個img,每次點擊時候,更改img的src,即圖片路徑。
<div><!-- 這個div放置img圖片 -->5、網頁設計如何實現圖片內按鈕點擊後展示子圖片
flash 比較生動一點更生動。
也可以是用js。
或者你簡單點用框架,點擊圖片,更新小圖片。
其實解決辦法有很多。
6、網頁設計中怎麼對按鈕插入超鏈接
按鈕不支持加超鏈接,但是有方法讓你點擊按鈕後跳轉網頁
當前頁面打開
<input type=button onclick="window.location.href('連接')">
新窗口打開
<input type=button onclick="window.open('連接')">
建議使用其他行內標簽來做超鏈接 因為能用html實現,最好就不要用css,能用css實現的就不要用js
7、菜鳥求助:網頁設計 如何實現一個button點擊時 多個單選項被選中
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div class="from">
<label for="time1"><p>語音:</p><input type="radio" value="60" name="time" id="sj0"/> 60分鍾</label>
<label for="time2"> <input type="radio" value="120" name="time" id="sj1"/> 120分鍾 </label>
<label for="anxin1"> <p>簡訊:</p><input type="radio" value="60" name="anxin" id="dx0"/> 100條</label>
<label for="anxin2"> <input type="radio" value="120" name="anxin" id="dx1"/> 200條</label><br><br>
<button onclick="button0()">套餐一:60分鍾+100條</button>
<button onclick="button1()">套餐二:120分鍾+200條</button>
</div>
<script>
function button0(){
$("input[name='time']").get(0).checked=true;
$("input[name='anxin']").get(0).checked=true;
}
function button1(){
$("input[name='anxin']").get(1).checked=true;
$("input[name='time']").get(1).checked=true;
}
</script>
</body>
</html>
我就大概寫了個功能,希望能幫助到你。
8、html網頁製作,javascript,一個按鈕如何有兩種功能?為什麼按鈕點擊兩次才行?
當你點擊按鈕的時候,document.getElementById('text').style.display這個值是空,不是'block',所以會進入else條件里,所以第一次隱藏不了
1. 你可以在div的style里加入display:block;讓div的初始值為block,這樣就能進入if里了
style="position:fixed; z-index:1;display:block;"
2. 或者不加display:block;,把js那段改成下面也可以:
if (document.getElementById('text').style.display==''){兩種方法都可以,希望可以幫到你
9、網頁設計疑問:利用一個按鈕點擊,執行頁面當中的一段ASP代碼,如何實現???
給你一個最簡單的例子:
<%
'取傳遞參數
ms=request.QueryString("ms")
'根據參數執行不同的代碼
select case ms
case 1
response.write "abc"
case 2
response.write "ddd"
'......這里可以寫更多
end select
%>
<input type="button" id="cmd1" value="按鈕1" onclick="javascript:cmd(1)" /><input type="button" id="cmd2" value="按鈕2" onclick="javascript:cmd(2)" />
<script language="javascript">
<!--
function cmd(mv){
document.location.href="?ms="+mv;
}
//-->
</script>
10、關於網頁製作:怎樣在網頁中點擊按鈕,然後彈出新窗口?
的window.open('page.html的','newwindow','高度= 100,寬= 400,= 0,左= 0時,工具欄=沒有,菜單=沒有,滾動條=沒有,可調整大小=沒有,位置=沒有狀態=沒有)