首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jquery 让div正当中显示

2012-07-08 
jquery 让div居中显示function showsearch(){ var wnd $(window), doc $(document)var left doc.sc

jquery 让div居中显示

function showsearch(){ var wnd = $(window), doc = $(document);  var left = doc.scrollLeft();  var top = doc.scrollTop(); left += (wnd.width() - $("#seachdiv").width())/2;  top += (wnd.height() - $("#seachdiv").height())/2;   $("#seachdiv").css("position","absolute");  $("#seachdiv").css("top",top);  $("#seachdiv").css("left",left); if($("#seachdiv").css("display")=="none") { $("#seachdiv").show("slow"); }else { $("#seachdiv").hide("slow"); }}

热点排行