◆少前百科是非盈利性、非官方的少女前线维基百科。
◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科
◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科
◆To foreigners,You can use twitter to contact us.
Icon Nyto Silver.png

Widget:InnCollapse

来自少前百科GFwiki
莹lolo讨论 | 贡献2020年12月1日 (二) 02:34的版本 (测试)
跳转至: 导航搜索

<script type="text/javascript">(window.RLQ=window.RLQ||[]).push(function(){ /* 调用多次时仅添加一次事件 */ if(!thisCollapse){

   var thisCollapse = document.querySelectorAll(".innCollapse");
   $(window).resize(function() { 
       $(".innCollapse").children().css("max-width", parseInt(Number($(".innCollapse").parent().width()) -40));});
   $(window).load(function() { 
       forInnColResize();})

} /*  折叠展开   */ function forInnCollapse(element){

   var nextElement = $(element).next().next();
   if($(element).attr("status") == "none"){ 
       $(element).attr("status", "visible");
       $(element).children().children("img").attr("src", "http://www.gfwiki.org/images/8/8d/InnCollapse_up.png");
       nextElement.slideDown("fast");}
   else{ 
       $(element).attr("status", "none");
       $(element).children().children("img").attr("src", "http://www.gfwiki.org/images/a/ac/InnCollapse_down.svg");
       nextElement.slideUp("fast");}

}

/*  宽度改变   */ function forInnColResize() {

   var thisE = $(".innCollapse");
   thisE.next().css("display", "none");
   if(thisE.attr("widthset")){
       thisE.children().width(thisE.attr("widthset"));}
   else{
       var nextE = thisE.next().next();
       thisE.children().width(parseInt(Number(nextE.css("width")) - 40));
       thisE.children().css("max-width", parseInt(Number(thisE.parent().width()) -40));
       thisE.unbind('click').removeAttr('onclick').click(function(){ forInnCollapse(this);});

} })</script>