Tab tab jump, create new tab and Jump tab in IFRAME

Source: Internet
Author: User
The first way to link with href:
[javascript]  View Plain  copy function addtab (title, url) {                if  (' #tt '). Tabs (' exists ',  title) {                    $ (' #tt ') . Tabs (' select ',  title);                } else {                    $ (' #tt '). Tabs (' Add ',{                        title:title,                         Content shown in Href:url,     //tab                         closable:true                   &NBSP});                }           }   The second type is in the form of an IFRAME:
Function addtab (title, url) {                if  (' #tt '). Tabs (' exists ',  title)) {                    $ (' #tt '). Tabs (' select ',  title);               } else {                    var content  =  ' <iframe scrolling= "Auto"  frameborder= "0"   src= "' +url+ '"  style= "width : 100%;height:100%; " ></iframe> ';                    $ (' #tt '). Tabs (' Add ',{                        title:title,       &Nbsp;                content: Content shown in Content,   //tab                         closable:true        &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP});                }            }  
To implement the link in the tab content, add a tab to the Parent tab, and the parent tab must be added as an IFRAME.

In the tab content, which is the URL page, you need to implement the following method on the link:

[javascript]  View Plain  copy function Add (title,url) { //title tab's name//url tab's link address
  &NBS P var parent$ = self.parent.$;      //Find the parent Dom  
    if (parent$ (' #tabs '). Tabs (' exists ', title) { 
  &NB Sp parent$ (' #tabs '). Tabs (' select ', title); &NBSP
   } else { 
        var content = ' <iframe scrolling= ' auto ' Frameb Order= "0"  src= "' +url+ '" "style=" width:100%;height:100%; " ></iframe> '; &NBSP
        parent$ (' #tabs ') tabs (' Add ', { 
            Title:title,  
            content:content,  //tab content  
  &N Bsp         closable:true  
       }); &NBSP
   }  
}

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.