goTOP
採用獨自開發 RWD Bo-Blog插件 對應電腦版與手機版網頁。一次上架多版本對應、顯示迅速方便。
April 12, 2015
點擊在新視窗中瀏覽此圖片
同時秀出價格

點擊在新視窗中瀏覽此圖片
同時秀出價格

CSS (head)
/*隱藏區塊用*/
.box{display: none;}
/*秀出區塊用*/
.bS01{}
.bS02{}
.bS03{}
/*區塊範圍指定*/
.bBW{}


JavaScript (head)
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
        $('input[type="radio"]').click(function(){
            if($(this).attr("value")=="bOne"){
                $(".box").hide();
                $(".bS01").show();
            }
            if($(this).attr("value")=="bTwo"){
                $(".box").hide();
                $(".bS02").show();
            }

        });
    });
</script>

March 12, 2015
CSS部分
<style type="text/css">
span{border:#999 solid 1px; padding:3px; border-radius:6px; -moz-border-radius:6px; -webkit-border-radius:6px;}
div#show{ margin:10px 0 0 0; padding:5px; border:#999 dashed 1px;}
</style>


javascript 部分
<script type='text/javascript'>
function show(obj, id)
{
  var o=document.getElementById(id);
  if( o.style.display == 'none' )
  {
    o.style.display='';
    obj.innerHTML='隱藏';
  }
  else
  {
    o.style.display='none';
    obj.innerHTML='顯示';
  }
}
</script>


html 部分
<span onclick='show(this, "show")'>顯示</span><br>
<div id='show' style="display:none;">按下文字按鈕後呈現內容</div>

March 8, 2015
css部分
<style type="text/css">
div#show{ margin:10px 0 0 0; padding:5px; border:#999 dashed 1px;}
</style>


javascript部分
<script type="text/javascript">
<!--
  function show(obj,item){
    document.getElementById(item).style.display = obj.checked?"block":"none";
  }
//-->
</script>


html部分
<input type="checkbox" onclick="show(this,'show');" />
<div id="show" style="display:none">這是顯示的內容</div>

註:show可以任意改為其他文字
January 15, 2013
點擊在新視窗中瀏覽此圖片

CSS3中似乎只有一個寫法是不對應所有瀏覽器的...
已下為參考寫法...

.test {
width: 300px;
height: 1.4em;
text-overflow: ellipsis; /* Safari 用 */
-o-text-overflow: ellipsis; /* Opera 用 */
overflow: hidden;
white-space: nowrap; /* 文字不折行功能。一定要寫入,否則不會出現效果 */
border: 1px solid #666666;
}
.test:hover {
text-overflow: inherit; /* Safari 用 */
-o-text-overflow: inherit; /* Opera 用 */
overflow: visible;
}


HTML BODY中寫入
<div class="test"> 如果你要呈現過長的文章,請用滑鼠確認一下喔 </div>


sample:
http://blog.apao.idv.tw/sample/CSS3/text-overflow.html

參考:
http://blog.flugel.biz/2009/07/css3-text-overflow.html
http://www.w3schools.com/cssref/pr_text_white-space.asp
分頁: 1/1 第一頁 1 最後頁 [ 顯示模式: 摘要 | 清單 ]