MVC tab TEST
How do I make an mvc tab test?
MVC tab TEST. What is a mvc tab test? How do you make a mvc tab test? This script and codes were developed by NaKaz on 31 August 2022, Wednesday.
MVC tab TEST - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>MVC tab TEST</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!--sw basic tab--> <div class="the-tab"> <nav class="tab-link-list"> <a class="tab-link tab-active" href="#content-A">(MVC model)</a> <a class="tab-link" href="#content-B">View</a> <a class="tab-link" href="#content-C">Controller</a> </nav> <article id="content-A" class="tab-content tab-active"> <h1>Model</h1> <p>そのアプリケーションが扱う領域のデータと手続き(ビジネスロジック - ショッピングの合計額や送料を計算するなど)を表現する要素である。また、データの変更をviewに通知するのもmodelの責任である(modelの変更を通知するのにObserver パターンが用いられることもある)。<br> 多くのアプリケーションではデータの格納に永続的な記憶の仕組み(データベースなど)が使われている。MVCの概念では、データの(UI以外の)入出力は取り扱わないので、データアクセスも本来MVCの概念の範疇を超えるものではあるが、敢えていえばmodelの中に隠蔽されると考えられる。</p> </article> <article id="content-B" class="tab-content"> <h1>View</h1> <p>modelのデータを取り出してユーザが見るのに適した形で表示する要素である。すなわちUIへの出力を担当する。<br> 例えば、ウェブアプリケーションではHTML文書を生成して動的にデータを表示するためのコードなどにあたる。</p> </article> <article id="content-C" class="tab-content"> <h1>Controller</h1> <p>ユーザの入力(通常イベントとして通知される)に対して応答し、それを処理する要素である。すなわちUIからの入力を担当する。modelとviewに変更を引き起こす場合もあるが、直接に描画を行ったり、modelの内部データを直接操作したりはしない。<br> なお、UIにおける入力と出力は本質的には不可分なものであり、したがってviewとcontrollerはいつでも分離できるとは限らない。このようなM-VCとなるような構造を拡張MVCと呼ぶことがある。</p> </article> </div> <!--sw basic tab--> <br /> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
MVC tab TEST - Script Codes CSS Codes
.tab-link { background-color: #eee; border: 1px #999; border-style: solid solid none; display: inline-block; line-height: 1.5em; padding: 0 8px;
}
.tab-link.tab-active { background-color: #fff; border-bottom: solid 1px #fff; margin-bottom: -1px;
}
.tab-content { background-color: #fff; border: solid 1px #999; display: none; padding: 4px;
}
.tab-content.tab-active { display: block;
}
MVC tab TEST - Script Codes JS Codes
(function() { (function($, win, doc) { var $doc, $win, swns; $win = $(win); $doc = $(doc); swns = { fnName: "tab" }; $.fn[swns.fnName] = function() { return this.each(function(index, elem) { var TabController, tabModel, tabView; tabModel = { attributes: {}, get: function(name) { return this.attributes[name]; }, set: function(name, value) { var obj, oldValue; oldValue = this.attributes[name]; this.attributes[name] = value; if (value !== oldValue) { obj = {}; obj[name] = value; return $(this).trigger("swEvtChange", obj); } }, info: function() { return typeof console !== "undefined" && console !== null ? console.info("getter:", this.attributes) : void 0; } }; tabView = $.extend(jQuery(elem), { initialize: function(model) { var self; self = this; $(model).on("swEvtChange", function(event, values) { return self.onchange(event, values); }); return self.find(".tab-link").first().trigger("click"); }, onchange: function(event, values) { var id, selector, self; self = this; self.find(".tab-active").removeClass("tab-active"); id = values.target.slice(1); selector = "#" + id + ",[href$=#" + id + "]"; return self.find(selector).addClass("tab-active"); } }); TabController = (function() { function TabController(model1, view1) { this.model = model1; this.view = view1; view.on("click", ".tab-link", function(e) { var $link, target; e.preventDefault(); $link = $(e.target).closest("a"); target = $link.attr("href"); return model.set("target", target); }); model.set("swSetTest", "(´・_・`)set"); model.set("swMofu", "(´・_・`)もふもふ..."); view.initialize(model); } return TabController; })(); new TabController(tabModel, tabView); if (typeof console !== "undefined" && console !== null) { console.info("Model:", tabModel); } if (typeof console !== "undefined" && console !== null) { console.info("View:", tabView); } return tabModel.info(); }); }; return $(function() { return $(".the-tab").tab(); }); })(jQuery, this, this.document);
}).call(this);
Developer | NaKaz |
Username | nakakaz11 |
Uploaded | August 31, 2022 |
Rating | 3 |
Size | 4,804 Kb |
Views | 34,408 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
D3.js d3.geo.projection TEST | 7,169 Kb |
Test OMG Particles II | 2,879 Kb |
CountUP Class sandbox | 3,229 Kb |
A Pen by NaKaz | 2,669 Kb |
D3.js su_ji_Force | 4,348 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Multi-step GSAP animation | Acacheung | 2,668 Kb |
APortfolio | Skybutterfly | 5,174 Kb |
Iron Man SVG Loading Animation | Andythayer | 3,069 Kb |
Sticky div | Kaslab | 2,225 Kb |
Z-index demo | Kblh | 1,534 Kb |
Email Marketing Mock | Kristenzirkler | 8,224 Kb |
Sticky menu on scroll | Senff | 2,869 Kb |
Experiments with Vertical Centering | KatieK2 | 3,924 Kb |
Material Design-Layout-Principles Practice | Fraina | 2,331 Kb |
A Pen by Gregory Potdevin | GregoryPotdevin | 1,713 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!