Jquery Tab Plugin wdscrolltab incompatible issues in chrome

Source: Internet
Author: User

Put the code called in the JSP first

var gh = "${teacher." GH} "; var Grjlurl = _webrootpath +" content/search/teacher/teacher.grjl.jsp?gh= "+gh;var jctabs = [' <iframe width= ' 100 % "scrolling=" no "height=" 100% "frameborder=" 0 "src=" ' +grjlurl+ ' "id=" Grjllist "name=" Grjllist "></iframe>", ' <iframe width= ' 100% "scrolling=" no "height=" 100% "frameborder=" 0 "src=" "id=" Kyxmlist "name=" Kyxmlist "></ Iframe> ', ' <iframe width= ' 100% "scrolling=" no "height=" 100% "frameborder=" 0 "src=" "id=" Xslwlist "Name=" xslwList "></iframe>", ' <iframe width= "100%" scrolling= "no" height= "100%" frameborder= "0" src= "" id= "xszzlist" name = "Xszzlist" ></iframe> ', ' <iframe width= "100%" scrolling= "no" height= "100%" frameborder= "0" src= "" id= " Zscqlist "Name=" Zscqlist "></iframe>", ' <iframe width= ' 100% "scrolling=" no "height=" 100% "frameborder=" 0 " Src= "id=" hjcglist "name=" Hjcglist "></iframe>", ' <iframe width= "100%" scrolling= "yes" height= "100%" Frameborder= "0" src= "id=" xcdylist "name=" Xcdylist ";</iframe> '];j$ (document). Ready (function () {var tabpanel2 = new TabPanel ({renderto: ' tab ', Width: ' 99% ',//heigh T: ' 331 ',//border: ' None ', Active:0,//autoresizable:true,//maxlength:6, items: [{id: ' toolbarPlugin1 ', title: ' Biographical ', Html:jctabs[0],closable:false},{id: ' ToolbarPlugin2 ', title: ' Research Project ', Html:jctabs[1],closable:false, func: ' Dosearchlist (1, "Kyxmlist", "getkyxmlist.action") '},{id: ' toolbarPlugin3 ', Title: ' Academic paper ', html:jctabs[2],closable: False, Func: ' Dosearchlist (1, "Xslwlist", "getxslwlist.action") '},{id: ' ToolbarPlugin4 ', Title: ' Academic Writings ', html:jctabs[3] , Closable:false, func: ' Dosearchlist (1, "Xszzlist", "getxszzlist.action") '},{id: ' ToolbarPlugin5 ', title: ' Intellectual Property ', HTML : Jctabs[4],closable:false, Func: ' Dosearchlist (1, "Zscqlist", "getzscqlist.action") '},{id: ' ToolbarPlugin6 ', title: ' Winning results ', Html:jctabs[5],closable:false, func: ' Dosearchlist (1, "Hjcglist", "gethjcglist.action") '},{id: ' ToolbarPlugin7 ', Title: ' Remuneration Package ', Html:jctabs[6],closable:false, func: ' Dosearchlist (1, "Xcdylist", "getxcdylist.action ") '}]});  });

In Ff,ie and other browsers are displayed normal


But in chrome there are strange problems, sometimes the entire tab height only one line, the following content does not show


or become the following.

Looking at the code discovery, the first mistake was because in Tabpanel.js, alert (This.render.height ()) got 0, it felt strange, I wrote an HTML test alone, and there was no such problem, but here, The height of the render is 0.renderTo pointing to the <div id= "tab" ></DIV> later, I changed it to <div id= "tab" style= "height:100%" > </div> after the normal, the height is not taken out of 0.

This.height = Config.height | | ' 100% '; this.render = typeof This.renderto = = ' String '? $ (' # ' +this.renderto): This.renderto;this.render.height (this.height); This.tabpanel = $ (' <DIV></DIV> '); This.tabpanel.addClass (' TabPanel '); This.tabpanel.width (This.render.width ()-hwfix); This.tabpanel.height ( This.render.height ()-hwfix);

The second mistake I found was that the following section was executed two times.

j$ (document). Ready (function () {}
Best of all, after the internet to see someone said jquery appendto may cause this problem, and then modify the code

          var loaded = false;j$ (document). Ready (function () {if (!loaded) {loaded = true; var tabpanel2 = new TabPanel ({renderto: ' tab ', Width: ' 99% ',//height: ' 331 ',//border: ' None ', active:0,//autoresizable:true,//maxlength:6, items: [{id: ' toolbarPlugin1 ', ti Tle: ' Biographical ', Html:jctabs[0],closable:false},{id: ' ToolbarPlugin2 ', title: ' Research Project ', Html:jctabs[1],closable:false, func : ' Dosearchlist (1, "Kyxmlist", "getkyxmlist.action") '},{id: ' toolbarPlugin3 ', Title: ' Academic paper ', html:jctabs[2],closable: False, Func: ' Dosearchlist (1, "Xslwlist", "getxslwlist.action") '},{id: ' ToolbarPlugin4 ', Title: ' Academic Writings ', html:jctabs[3] , Closable:false, func: ' Dosearchlist (1, "Xszzlist", "getxszzlist.action") '},{id: ' ToolbarPlugin5 ', title: ' Intellectual Property ', HTML : Jctabs[4],closable:false, Func: ' Dosearchlist (1, "Zscqlist", "getzscqlist.action") '},{id: ' ToolbarPlugin6 ', title: ' Winning results ', Html:jctabs[5],closable:false, func: ' Dosearchlist (1, "Hjcglist", "gethjcglist.action") '},{id: ' ToolbArPlugin7 ', Title: ' Remuneration Package ', Html:jctabs[6],closable:false, func: ' Dosearchlist (1, ' xcdylist ', ' getxcdylist.action ') '}]  }); }});

After adding an identity loaded, the problem is finally resolved.






Jquery Tab Plugin wdscrolltab incompatible issues in chrome

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.