About jqueryUI tab page sample code

小云云
Release: 2017-12-27 09:34:00
Original
1698 people have browsed it

This article mainly shares the jqueryUI tab page code for everyone, which has certain reference value. Interested friends can refer to it. I hope it can help everyone.

The example in this article shares the specific code of the jqueryUI tab page for your reference. The specific content is as follows


var temp=1; var arr=["我的首页"]; //×号点击关闭li $("#tabs").delegate( ".ui-icon-close", "click", function() { var panelId = $( this ).closest( "li" ).remove().attr( "aria-controls" ); var val= $( this ).closest( "li" ).children("a").text(); for( i=0;i'); html.push('

'); html.push('

'); $(tab).append(html.join("")); $(tab).find("iframe").height($(window).height()-80); } return false; } //点击左边按钮后,创建tab $(".layui-nav-child").on('click','dd',function(){ var tab_name=$(this).text(); var title_1=$(this).children("a").attr("title"); //未创建过,则创建标签 if(arr.indexOf(tab_name)==-1){ arr.push(tab_name); var link_url= $(this).children("a").attr("title"); temp++; addTab(tab_name,link_url,temp); } //创建了,则跳转到已存的标签页 else{ $("#mm li a").each(function(i,val){ if($(this).attr("rel")==title_1){ var jjjj=$(this).attr("href"); $("#tabs").tabs("option","active", $(jjjj).index()-1); loadTabFrame(jjjj,title_1); return false; } }); } }); //创建标签 function addTab(name,url,temp1){ var hre="#contant_"+ temp1; var hre1="contant_"+ temp1; //var li="
  • "+name+"×
  • "; var li="
  • "+name+"×
  • "; //alert(li); // $(li).appendTo(".m-tabList").addClass('tabCur').siblings('li').removeClass('tabCur'); var p="

    "; $("#tabs" ).find( ".ui-tabs-nav" ).append( li ); // var panelId = $( this ).closest( "li" ).attr( "aria-controls" ); $("#tabs").append(p); $("#tabs").tabs("refresh"); $("#tabs").tabs("option","active",$("#tabs").find(hre).index()-1); loadTabFrame(hre,url); }
    Copy after login

    Related recommendations:

    JavaScript code sharing: tab label switching

    Explanation of the effect of tab label switching using JavaScript

    js and How jquery implements tab page functions respectively

    The above is the detailed content of About jqueryUI tab page sample code. For more information, please follow other related articles on the PHP Chinese website!

    Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!