a6e3d32dfce144ff84a7f41d91e137f5cbc58985.svn-base 646 B

1234567891011121314151617181920212223242526272829303132
  1. $(function() {
  2. setSelectWidth();
  3. });
  4. /***
  5. * 2016.03.01
  6. * 庄会亮
  7. * 功能:为页面下拉框和下拉树的宽度赋值。
  8. * @returns
  9. */
  10. function setSelectWidth(){
  11. //为下拉框宽度赋值
  12. $.each($(".selectWidth"),function(n,value) {
  13. var width = $(value).attr("swidth");
  14. if(width==""||width==undefined){
  15. return;
  16. }
  17. if(width!="100%"){
  18. width = width.substring(0,width.length-1);
  19. if(width.indexOf(".")!=-1){
  20. width=width/100;
  21. }else{
  22. width = "0."+width;
  23. }
  24. }else{
  25. width = 1;
  26. }
  27. width = parseInt($(value).parent().css("width"))*width;
  28. $(this).attr("selWidth",width);
  29. $(this).render();
  30. });
  31. }