search_public.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // 搜索页面 单独加载效果
  2. //创建一个弹出层,width 宽度,height 高度,url
  3. function CreatePopLayerDiv2(width,height,url){
  4. var Iheight=$(window).height();
  5. var Iwidth =$(window).width();
  6. var heights = height || 300;
  7. var widths = width || 500;
  8. var Oheight= (Iheight -heights) / 2;
  9. var Owidth = (Iwidth - widths) /2;
  10. var div ='<div id="InDiv2" style="width:'+Iwidth+'px;height:'+Iheight+'px; background:#fff; position:fixed;z-index:30;top:0;left:0;">';
  11. div+='<div id="offDiv2" style=" width:100%; height:100%; left:0px; top:0px; position:fixed;z-index:32;">';
  12. // div+='<a id="AClose2" class="y_close" style="position: absolute;left:8px; z-index:32; top:13px; width:30px; height:30px;display:block;" href="javascript:;" onclick="btnCloses2();"><img src="/image/u5.png" width="100%" alt="" /></a>';
  13. div+='<div id="Content2"></div>';
  14. div+='</div>';
  15. div+='</div>';
  16. $(document.body).append(div);
  17. if(url != ""){
  18. $("#Content2").load(url);
  19. }
  20. }
  21. //移除弹出层
  22. function RemoveDiv2(){
  23. $("#offDiv2").remove();
  24. $("#InDiv2").remove();
  25. }
  26. function btnCloses2(){
  27. RemoveDiv2();
  28. $('#serachBox2').show();
  29. $('.my_needs').show();
  30. $('.home_module_channel').show();
  31. $('.footer_copy').show();
  32. }
  33. $(function(){
  34. $(".y_lplist_inp").click(function(){
  35. CreatePopLayerDiv2('100%','100%',"/index/searchalert"); //添加加载页面
  36. $('#serachBox2').hide();
  37. $('.my_needs').hide();
  38. $('.home_module_channel').hide();
  39. $('.footer_copy').hide();
  40. // $('#offDiv2').css({'top':'-800px'}).animate({top:'0%'});
  41. });
  42. })