<a data-placement="bottom" data-toggle="popover" data-trigger="focus" data-container="body" data-placement="left" type="button" data-html="true" id="login"><button type="button" class="btn  btn-info btn-block">點擊送審</button></a>
<div id="popover-content" class="hide">
      <div class="form-group"> 
        <br/>
        <button type="button" class="btn  btn-primary btn-block">更換圖片</button>
        <br/>
        <button type="button" class="btn  btn-primary btn-block">點擊送審</button>
        </div>
 </div>

文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()

zend framework 方法不要依名稱跳頁

$this->_helper->viewRenderer->setNoRender(true);
$this->view->layout()->disableLayout();

 

強制轉跳頁面

$this->_redirect('power/student/studentindex');

文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()

SELECT *  FROM table as t1
left join table2 as t2
on t1.id = t2.t1_id
where t2.time = (SELECT max(time) from table2 as t22
where t22.t1_id=t1.id);

參考資料:

http://dev.mysql.com/doc/refman/5.7/en/example-maximum-column-group.html

文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()

<script>
        $(function(){
                $("#div id").hide();
                $("#checkbox id").change(function(){
                        if ($(this).is(':checked')) {
                                $("#div id").show();
                        } else {
                                $("#div id").hide();
                        }
                });
        });
</script>  
文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()

jquery

<script>
$(document).ready(function(){
    $('.fontSizeToBig').click(function() {
        $(".modal-body").css('font-size',"30px");
    });
    $('.fontSizeBig').click(function() {
        $(".modal-body").css('font-size',"20px");
    });
    $('.fontSizePreset').click(function() {
        $(".modal-body").css('font-size',"14px");
    });    
});
</script>

 


按鈕部分

<div style="float: right;">字型:

 <button type="button" style="font-size:15px;font-weight: bold;" class="btn btn-xs fontSizePreset">預設 </button>

 <button type="button" style="font-size:15px;font-weight: bold;" class="btn btn-xs fontSizeBig">中 </button>

 <button type="button" style="font-size:15px;font-weight: bold;" class="btn btn-xs fontSizeToBig" >大 </button>

</div>


要改變的內容部分

<div class="modal-body" id="modal-body">
 <p>內容:<?php echo $bb2['content'];?></p>
</div>

文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()

<?php 
        $that_time = strtotime($bb2['created_date']);
        $this_time = mktime();
        $diff = ($that_time - $this_time)/ (60*60*24);  //計算日期差 / Calculate the date difference
        // $diff = ($that_time - $this_time);                 //計算秒數差 / Calculate the difference in seconds
        // $diff = ($that_time - $this_time)/ (60) ;         //計算分鐘差 / Calculate the minute difference
        // $diff = ($that_time - $this_time)/ (60*60);        //計算小時差 / Calculate the hour difference
        if ($diff>=-2){ //    當時間大於2天 / When the time is greater than 2 days
?>
    <span class="badge pull-right">New</span> 
<?php } ?>
文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()

 

<select onChange="location = this.options[this.selectedIndex].value;">
  <option value="#">請選擇</option>
  <option value="https://www.google.com.tw">Google 台灣</option>
  <option value="http://tw.yahoo.com">Yahoo! 奇摩</option>
  <option value="http://www.php.net">PHP.net</option>
</select>

 

這個 select 選單的第一行我們用了『onChange="location = this.options[this.selectedIndex].value;"』這樣的語法,當選單被改變的時候,會執行等號右邊的 JavaScript 程式碼,而 location 用來執行跳頁,『 this.options[this.selectedIndex].value』用來抓取網友所選擇的項目值,可以看到 select 的每個選項(option)都有一個 value,設定每個 value 的值為不同的網址,這樣 JavaScript 就知道要前往哪個網頁囉!(第一個 option 由於僅用來顯示「請選擇」的文字,所以 value 的值只給 # 字號,這樣選擇第一項就不會跳到別的網頁)

JavaScript 的 onChange 事件通常用來根據網友的動作而執行程式碼,除了可以用在 select option 下拉式選單之外,也可以用在其他的表單欄位,例如 text、textarea ... 等,只要是當網友去改變欄位值而需要觸發事件的時候都可以適用

-----------------------------------------------------------------

轉自  Wibibi 網頁設計教學百科

http://www.wibibi.com/info.php?tid=205

文章標籤

kkkelu1008 發表在 痞客邦 留言(0) 人氣()

«123