Detailed explanation of jqueryUI tab label example
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.
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<arr.length;i++){ if(arr[i] == val) { arr.splice(i, 1); break; } } // alert(paneiId); $( "#" +panelId ).remove(); $("#tabs").tabs( "refresh" ); // $("#tabs").tabs("option","active",$("#tabs").find(hre).index()-1); if($( "#" +panelId).parent.attr("tabindex")=="0"){ $("#tabs").tabs("option","active",$( "#" +panelId).index()-1); } }); $("#tabs").bind( "keyup", function( event ) { if ( event.altKey && event.keyCode === $.ui.keyCode.BACKSPACE ) { var panelId = $("#tabs").find( ".ui-tabs-active" ).remove().attr( "aria-controls" ); $( panelId ).remove(); // alert(456); $("#tabs").tabs( "refresh" ); } }); //加入iframe $("#tabs").tabs(); function getSelectedTabIndex() { return $("#tabs").tabs('option', 'active'); } //get tab contents and load frame beginTab = $("#tabs ul li:eq(" + getSelectedTabIndex() + ")").find("a"); loadTabFrame($(beginTab).attr("href"),$(beginTab).attr("rel")); //页签切换 $("#mm").on('click','a',function(){ loadTabFrame($(this).attr("href"),$(this).attr("rel")); }) function loadTabFrame(tab, url) { if ($(tab).find("iframe").length == 0) { var html = []; html.push('<p class="tabIframeWrapper">'); html.push('<p class="openout"><a href="' + url + '" rel="external nofollow" ></a></p><iframe class="iframetab" src="' + url + '">Load Failed?</iframe>'); html.push('</p>'); $(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="<li><a class='tabLink' href="+url+" rel="external nofollow" target='conFrame'>"+name+"</a><i class='icon-closeA'>×</i></li>"; var li="<li><a class='tabLink' href='"+hre+"' rel='"+url+"'>"+name+"</a><i class=\"ui-icon-close\">×</i></li>"; //alert(li); // $(li).appendTo(".m-tabList").addClass('tabCur').siblings('li').removeClass('tabCur'); var p="<p id='"+hre1+"'></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); }
Related recommendations:
JQuery study notes to achieve image flipping effect and TAB label switching effect_jquery
A tab label switching effect code_extjs
The above is the detailed content of Detailed explanation of jqueryUI tab label example. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Windows operating system is one of the most popular operating systems in the world, and its new version Win11 has attracted much attention. In the Win11 system, obtaining administrator rights is an important operation. Administrator rights allow users to perform more operations and settings on the system. This article will introduce in detail how to obtain administrator permissions in Win11 system and how to effectively manage permissions. In the Win11 system, administrator rights are divided into two types: local administrator and domain administrator. A local administrator has full administrative rights to the local computer

Detailed explanation of division operation in OracleSQL In OracleSQL, division operation is a common and important mathematical operation, used to calculate the result of dividing two numbers. Division is often used in database queries, so understanding the division operation and its usage in OracleSQL is one of the essential skills for database developers. This article will discuss the relevant knowledge of division operations in OracleSQL in detail and provide specific code examples for readers' reference. 1. Division operation in OracleSQL

This tutorial shows you how to find specific text or phrases on all open tabs in Chrome or Edge on Windows. Is there a way to do a text search on all open tabs in Chrome? Yes, you can use a free external web extension in Chrome to perform text searches on all open tabs without having to switch tabs manually. Some extensions like TabSearch and Ctrl-FPlus can help you achieve this easily. How to search text across all tabs in Google Chrome? Ctrl-FPlus is a free extension that makes it easy for users to search for a specific word, phrase or text across all tabs of their browser window. This expansion

The modulo operator (%) in PHP is used to obtain the remainder of the division of two numbers. In this article, we will discuss the role and usage of the modulo operator in detail, and provide specific code examples to help readers better understand. 1. The role of the modulo operator In mathematics, when we divide an integer by another integer, we get a quotient and a remainder. For example, when we divide 10 by 3, the quotient is 3 and the remainder is 1. The modulo operator is used to obtain this remainder. 2. Usage of the modulo operator In PHP, use the % symbol to represent the modulus

Detailed explanation of Linux system call system() function System call is a very important part of the Linux operating system. It provides a way to interact with the system kernel. Among them, the system() function is one of the commonly used system call functions. This article will introduce the use of the system() function in detail and provide corresponding code examples. Basic Concepts of System Calls System calls are a way for user programs to interact with the operating system kernel. User programs request the operating system by calling system call functions

As a popular short video social platform, Douyin has a huge user base. For Douyin creators, using tags to attract traffic is an effective way to increase the exposure of content and attract attention. So, how does Douyin use tags to attract traffic? This article will answer this question in detail for you and introduce related techniques. 1. How to add tags on Douyin to attract traffic? When posting a video, make sure to choose tags that are relevant to the content. These tags should cover the topic and keywords of your video to make it easier for users to find your video through tags. Leveraging popular hashtags is an effective way to increase your video’s exposure. Research current popular tags and trends and incorporate them into your video descriptions and tags. These popular tags usually have higher visibility and can attract the attention of more viewers. 3. Label

Detailed explanation of Linux's curl command Summary: curl is a powerful command line tool used for data communication with the server. This article will introduce the basic usage of the curl command and provide actual code examples to help readers better understand and apply the command. 1. What is curl? curl is a command line tool used to send and receive various network requests. It supports multiple protocols, such as HTTP, FTP, TELNET, etc., and provides rich functions, such as file upload, file download, data transmission, proxy

When browsing Douyin works, we often see a clock icon behind the tag. So, what exactly is this clock? This article will focus on the discussion of "What is the clock behind the Douyin label", hoping to provide some useful reference for your use of Douyin. 1. What is the clock behind the Douyin label? Douyin will launch some hot topic challenges. When users participate, they will see a clock icon after the tag, which means that the work is participating in the topic challenge and displays the remaining time of the challenge. For some time-sensitive content, such as holidays, special events, etc., Douyin will attach a clock icon after the label to remind users of the validity period of the content. 3. Popular tags: When a tag becomes popular, Douyin will add a clock icon after the tag to indicate that the tag is
