{"id":255372,"date":"2022-10-29T08:24:21","date_gmt":"2022-10-29T00:24:21","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=255372"},"modified":"2022-10-20T12:25:03","modified_gmt":"2022-10-20T04:25:03","slug":"foundation-collapsed-lists","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/foundation-collapsed-lists.html","title":{"rendered":"Foundation \u6298\u53e0\u5217\u8868\u7b80\u4ecb"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u4f60\u60f3\u9690\u85cf\u90e8\u5206\u5185\u5bb9\u7684\u663e\u793a\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u6298\u53e0\u5217\u8868\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b9e\u4f8b<\/strong><\/p>\n

\r\n<ul class=\"accordion\" data-accordion>\r\n  <li class=\"accordion-navigation\">\r\n    <a href=\"#demo\">Simple Collapsible<\/a>\r\n    <div id=\"demo\" class=\"content\">\r\n      \u83dc\u9e1f\u6559\u7a0b -- \u5b66\u7684\u4e0d\u4ec5\u662f\u6280\u672f\uff0c\u66f4\u662f\u68a6\u60f3\uff01\uff01\uff01\r\n    <\/div>\r\n  <\/li>\r\n<\/ul>\r\n\r\n<!-- \u521d\u59cb\u5316 Foundation JS -->\r\n<script>\r\n$(document).ready(function() {\r\n    $(document).foundation();\r\n})\r\n<\/script>\t\r\n<\/pre>\n
\u5b9e\u4f8b\u89e3\u6790<\/strong><\/div>\n

.accordion \u7c7b\u548c data-accordion \u5c5e\u6027\u7528\u4e8e\u521b\u5efa\u4e00\u4e2a\u53ef\u6298\u53e0\u7684\u5143\u7d20\u3002 .accordion-navigation \u7c7b\u7528\u4e8e\u6e32\u67d3\u53ef\u6298\u53e0\u5143\u7d20\u3002\u5b9e\u9645\u7684\u5185\u5bb9\u5728 .content \u7c7b (<div class=\"content\") \u4e2d\uff0c\u70b9\u51fb\u6309\u94ae\u65e2\u53ef\u4ee5\u663e\u793a\u3002<\/p>\n

\u6211\u4eec\u5728\u5217\u8868\u9879\u4e2d\u6dfb\u52a0 <a> \u5143\u7d20\u6765\u63a7\u5236\uff08\u663e\u793a\/\u9690\u85cf\uff09\u53ef\u6298\u53e0\u7684\u5185\u5bb9\u3002\u7136\u540e\u951a\u94fe\u63a5\u4f7f\u7528\u4e0e\u53ef\u6298\u53e0\u5185\u5bb9\u5185\u5bb9\u76f8\u540c\u7684id (<a href=#demo\" \u4e0e <div id=\"demo\"> \u76f8\u5173\u8054)\u3002<\/p>\n

\u6ce8\u610f<\/strong>\uff1a \u53ef\u6298\u53e0\u7684\u6548\u679c\u9700\u8981\u521d\u59cb\u5316 Foundation JS\u3002<\/p>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ef\u6298\u53e0\u5185\u5bb9\u662f\u9690\u85cf\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728 <div> \u4e0a\u6dfb\u52a0 .active \u7c7b\u8ba9\u5176\u9ed8\u8ba4\u662f\u663e\u793a\u7684\uff1a<\/p>\n

\u5b9e\u4f8b<\/strong><\/p>\n

<div id=\"demo\" class=\"content active\"><\/pre>\n
\u624b\u98ce\u7434\u6548\u679c<\/strong><\/div>\n

\u624b\u98ce\u7434\u6548\u679c\u7528\u4e8e\u5ef6\u5c55\u4e0e\u8bbe\u7f6e\u53ef\u6298\u53e0\u5185\u5bb9\u3002<\/p>\n

\u624b\u98ce\u7434\u6548\u679c\u901a\u8fc7\u4f7f\u7528\u591a\u4e2a\u4e0d\u540c\u7684\u951a\u94fe\u63a5\u4e0eid\u6765\u521b\u5efa\uff1a<\/p>\n

\u5b9e\u4f8b<\/strong><\/p>\n

<ul class=\"accordion\" data-accordion>\r\n  <li class=\"accordion-navigation\">\r\n    <a href=\"#demo\">\u624b\u98ce\u7434\u5b9e\u4f8b 1<\/a>\r\n    <div id=\"demo\" class=\"content active\">\r\n      Demo 1 - \u83dc\u9e1f\u6559\u7a0b -- \u5b66\u7684\u4e0d\u4ec5\u662f\u6280\u672f\uff0c\u66f4\u662f\u68a6\u60f3\uff01\uff01\uff01\r\n    <\/div>\r\n  <\/li>\r\n  <li class=\"accordion-navigation\">\r\n    <a href=\"#demo2\">\u624b\u98ce\u7434\u5b9e\u4f8b 2<\/a>\r\n    <div id=\"demo2\" class=\"content\">\r\n      Demo 2 - Lorem ipsum dolor sit amet....\r\n    <\/div>\r\n  <\/li>\r\n  <li class=\"accordion-navigation\">\r\n    <a href=\"#demo3\">\u624b\u98ce\u7434\u5b9e\u4f8b 3<<\/a>\r\n    <div id=\"demo3\" class=\"content\">\r\n      Demo 3 - \u83dc\u9e1f\u6559\u7a0b -- \u5b66\u7684\u4e0d\u4ec5\u662f\u6280\u672f\uff0c\u66f4\u662f\u68a6\u60f3\uff01\uff01\uff01\r\n    <\/div>\r\n  <\/li>\r\n<\/ul><\/pre>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u624b\u98ce\u7434\u5217\u8868\u9879\u6709\u4e00\u4e2a\u662f\u6253\u5f00\u7684\u3002\u5982\u679c\u4f60\u60f3\u5173\u95ed\u6240\u6709\u53ef\u4ee5\u4f7f\u7528 data-options=\"multi_expand:true;\" \u5c5e\u6027:<\/p>\n

\u5b9e\u4f8b<\/strong><\/p>\n

<ul class=\"accordion\" data-accordion data-options=\"multi_expand:true;\">\r\n  ..\r\n<\/ul><\/pre>\n","protected":false},"excerpt":{"rendered":"

\u5b9e\u4f8b <ul class=”accordion” data-accordion> <li c […]<\/p>\n","protected":false},"author":321,"featured_media":255374,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-255372","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/255372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/321"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=255372"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/255372\/revisions"}],"predecessor-version":[{"id":255377,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/255372\/revisions\/255377"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/255374"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=255372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=255372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=255372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}