顯示具有 blogger 標籤的文章。 顯示所有文章
顯示具有 blogger 標籤的文章。 顯示所有文章

2020年12月14日 星期一

blogger讓所有iframe長寬比都變成16:9

iframe的比例在rwd的網站裡面要調整一直都很麻煩。用@media的方式只能抓個大概,所以就想用運算的方式一次搞定。

在</body>前面貼入以下程式碼就可以摟

<script>   function iframeheight(){     var aiframe = document.querySelectorAll('.post iframe');//抓取所有post裡面的iframe     console.log(aiframe);     [].forEach.call(aiframe, function(iframe) {       console.log(iframe);       var theCSSprop = window.getComputedStyle(iframe,null).getPropertyValue('width');         iframe.style.height = parseInt(theCSSprop)/16*9+'px';     });   console.log('called');   }   iframeheight(); </script>

2020年6月10日 星期三

Blogger電腦版和手機版都改成麵包屑

電腦版的側邊欄會佔掉整個版面的一部份,相比之下手機版的側邊欄你比較喜歡的話,可以考慮改成都是手機版的側邊欄隱藏版型。
先找   <b:if cond='data:view.isLayoutMode or not data:view.isSingleItem'>這一行code把裡面的code給覆蓋過去就完成摟。

<header>
 <div>
   <b:if cond='data:view.isLayoutMode or not data:view.isSingleItem'>

    <nav class='top-nav' role='navigation'>
     <b:class cond='data:view.isSingleItem' name='sticky'/>
     <b:section id='page_list_top' name='Page List (Top)' showaddelement='false'>
      <b:widget id='PageList1' locked='true' title='' type='PageList' visible='true'>
       <b:widget-settings>
        <b:widget-setting name='pageListJson'></b:widget-setting>
        <b:widget-setting name='homeTitle'>首頁</b:widget-setting>
       </b:widget-settings>
       <b:includable id='main'>
         <b:include name='widget-title'/>
         <b:include name='content'/>
       </b:includable>
       <b:includable id='content'>
         <div class='widget-content'>
          <b:include cond='data:widget.sectionId == "page_list_top"' name='overflowablePageList'/>
          <b:include cond='data:widget.sectionId != "page_list_top"' name='pageList'/>
         </div>
       </b:includable>
       <b:includable id='overflowButton'>
         <b:include name='verticalMoreIcon'/>
       </b:includable>
       <b:includable id='overflowablePageList'>
         <div class='overflowable-container'>
          <div class='overflowable-contents'>
           <div class='container'>
            <b:with value='true' var='overflow'>
            <b:with value='"tabs"' var='pageListClass'>
             <b:include name='pageList'/>
            </b:with>
            </b:with>
           </div>
          </div>
          <div class='overflow-button hidden'>
           <b:include name='overflowButton'/>
          </div>
         </div>
       </b:includable>
       <b:includable id='pageLink'>
                  <li>
<b:class cond='data:overflow' name='overflowable-item'/>
          <b:class cond='data:link.isCurrentPage' name='selected'/>

          <a expr:href='data:link.href'><data:link.title/></a>
         </li>
       </b:includable>
       <b:includable id='pageList'>
        <ul>
         <b:class cond='data:pageListClass' expr:name='data:pageListClass'/>
         <b:loop values='data:links' var='link'>
          <b:include name='pageLink'/>
         </b:loop>
        </ul>
       </b:includable>
      </b:widget>
     </b:section>
    </nav>

   </b:if>
  </div>

</header>