php我不知道怎么做,不知道和jsp是不是一樣的,不會(huì)php

海晏網(wǎng)站制作公司哪家好,找成都創(chuàng)新互聯(lián)公司!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、自適應(yīng)網(wǎng)站建設(shè)等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。成都創(chuàng)新互聯(lián)公司公司2013年成立到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選成都創(chuàng)新互聯(lián)公司。
1、在jsp中,你用jquery或者javascript非常好實(shí)現(xiàn),當(dāng)點(diǎn)擊性別時(shí),點(diǎn)擊就是個(gè)事件,這個(gè)事件所要做的事情就是顯示一個(gè)男女的DIV
2、當(dāng)在男女的DIV上選擇了性別后,隱藏這個(gè)div,并且在性別那顯示我們所選擇的性別男或女,我可以可以在隱藏的時(shí)候,把選擇的那個(gè)男或者女賦
值給性別DIV中的性別那一欄
3、學(xué)習(xí)下jqeury或者javascript實(shí)現(xiàn)起來超容易
4、下面是我寫的js代碼,你看你php能否同樣做出來,按照這個(gè)方法
!DOCTYPE
html
head
!-- 聲明當(dāng)前頁面的編碼集charset=gbk中文編碼gb2312,charset=utf-8國際編碼 --
meta http-equiv="Content-Type" content="text/html; charset=utf-8"
!-- 當(dāng)前頁面三要素 --
titletitle/title
meta name="Author" content="cn.huanghaiping"
meta name="Keywords" content="關(guān)鍵詞,關(guān)鍵詞"
meta name="Description" content="描述"
!-- css , js --
/head
body
divinput type="text" id="sextxt"input type="button" value="性別" id="sex" onclick="showsex()"/div
div id="sexradio" style="margin-top:10px;display:none;"
input type="radio" name="sex" value="男" onclick="selectsex(this)" 男
input type="radio" name="sex" value="女" onclick="selectsex(this)" 女
/div
script
function showsex(){
document.getElementById("sexradio").style.display = "block";
}
function selectsex(o){
document.getElementById("sextxt").value = o.value
document.getElementById("sexradio").style.display = "none";
}
/script
/body
/html
div input id='input1' type='text' /div
div ?id='b' style='position:absolute;left:20px;top:20px;display='none''/div//自己調(diào)整left和top的值將下面的div定位在上一個(gè)div的正下方
引如jquery文件
script
$(function(){
$("#b").hide();
$("#input1").focus(function(){
$("#b").slideDown("slow");
});
$("#input1").blur(function(){
$("#b").slideUp("slow");
});
});
/script
$(function(){
//?點(diǎn)擊按鈕,DIV彈出隱藏
$('#btn1').toggle(function(){
$('#div1').show();
},function(){
$('#div1').hide();
});
//?點(diǎn)擊按鈕,DIV彈出,點(diǎn)擊body任意地方隱藏div
$('#btn2').click(function(){
if?(?event??event.stopPropagation?)?{?
//?this?code?is?for?Mozilla?and?Opera?
event.stopPropagation();?
}?
else?if?(window.event)?{?
//?this?code?is?for?IE?
window.event.cancelBubble?=?true;?
}
$('#div2').show();
});
$(document).click(function(){
$('#div2').hide();
});
});
以上都必須要基于,div的css是合理的。
其中?event.stopPropagation(); 和?window.event.cancelBubble = true; 是阻止事件冒泡的寫法,建議自行百度學(xué)習(xí)。
css:(這里用了fixed,不考慮兼容性)
/*?水平垂直居中的div?*/
#div1,#div2{
position:?fixed;
top:?50%;
left:?50%;
background:red;
width:100px;
height:100px;
margin:-50px?0?0?-50px;
display:none;
}
同樣的功能有很多插件,例如fancybox,fancyzoom等
網(wǎng)站名稱:jquery彈div,jQuery彈出框
本文網(wǎng)址:http://chinadenli.net/article7/dsshhij.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣、營銷型網(wǎng)站建設(shè)、企業(yè)網(wǎng)站制作、網(wǎng)站設(shè)計(jì)公司、關(guān)鍵詞優(yōu)化、網(wǎng)站營銷
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容