日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > php >内容正文

php

php jquery实现弹窗,jquery 弹出层实现代码_jquery

發(fā)布時間:2024/10/12 php 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php jquery实现弹窗,jquery 弹出层实现代码_jquery 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

經(jīng)過分析,網(wǎng)上的參考,終于搞定了~~

jQuery插件代碼:

jQuery.fn.selectItem = function(targetId) {

var _seft = this;

var targetId = $(targetId);

this.toggle(

function() {

var A_top = $(this).offset().top + $(this).outerHeight(true); // 1

var A_left = $(this).offset().left;

targetId.bgiframe();

targetId.show().css({ "position": "absolute", "top": A_top + "px", "left": A_left + "px" });

}

, function() {

targetId.hide();

}

);

targetId.find("#selectItemClose").click(function() {

targetId.hide();

});

targetId.find("#selectSub :checkbox").click(function() {

targetId.find(":checkbox").attr("checked", false);

$(this).attr("checked", true);

_seft.val($(this).val());

targetId.hide();

});

$(document).click(function(event) {

if (event.target.id != _seft.selector.substring(1)) {

targetId.hide();

}

});

targetId.click(function(e) {

e.stopPropagation();

});

return this;

}

HTML代碼:

All

Confidence

css樣式:

/* pop div begin */

.selectItemcont{padding:8px;}

.selectItemtit{line-height:20px;height:20px;margin:1px;padding-left:12px;}

.bgc_ccc{background:#E88E22;}

.selectItemleft{float:left;margin:0px;padding:0px;font-size:12px;font-weight:bold;color:#fff;}

.selectItemright{float:right;cursor:pointer;color:#fff;}

.selectItemcls{clear:both;font-size:0px;height:0px;overflow:hidden;}

.selectItemhidden{display:none;}

#selectCompetencies

{

display:none;

background:#FFF;

position:absolute;

top:0px;

left:center;

border:1px solid #000;

overflow-x:hidden;

overflow-y:auto;

width:250px;

z-index:1000;

max-height:200px;

}

/* pop div end */

JavaScript代碼:

$("#txtCompetencies").selectItem("#selectCompetencies");

實現(xiàn)點擊文本框,在其正下方彈出一個新的層,再次點擊的時候,隱藏層。

后面的話,我會把這個插件繼續(xù)完善的~~~ O(∩_∩)O...

本文原創(chuàng)發(fā)布php中文網(wǎng),轉(zhuǎn)載請注明出處,感謝您的尊重!

總結(jié)

以上是生活随笔為你收集整理的php jquery实现弹窗,jquery 弹出层实现代码_jquery的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。