MVC + EasyUI + three-layer news website (six tabs completed), easyuitabs

Source: Internet
Author: User

MVC + EasyUI + three-layer news website (six tabs completed), easyuitabs

First, perform a simple layout for the Center.

<! -------------- Intermediate layout --------------> <div data-options = "region: 'center', title: 'center'"> <div class = "easyui-tabs" style = "width: 700px; height: 250px "fit =" true "id =" tt "> <div title =" welcome "> 

Then, the tabs click event is implemented in js.

In fact, the center is embedded with an iframe In the div, so the final returned result is an iframe

<Script type = "text/javascript"> $ (function () {// bindTabsEvent () ;}); function bindTabsEvent () {$ (". detail "). click (function () {// get the title var title = $ (this ). text (); // get the clicked url var url = $ (this ). attr ("url"); // determines whether the tag has var isExt =$ ("# tt "). tabs ("exists", title); // if yes, select if (isExt) {$ ("# tt "). tabs ("select", title); // select return;} // If the tag does not exist, add the tag $ ("# tt "). tabs ("add", {title: title, content: createTabContent (url), closable: true}) ;}) ;} function createTabContent (url) {return '<iframe src = "' + url + '" scrolling = "no" frameborder = "0" width = "100%" height = "100%"> </iframe>' ;} </script>

Note that the above detail is the value of the class selector in the navigation bar (the class must be the same here)

 

Code of the entire page

@ {Layout = null ;}<! DOCTYPE html> 

 

Related Article

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.