Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ผมเอา source code จากเพจนี้มาใช้ แต่ทำไม ฟังก์ชันมาไม่ครบก็ไม่รู้ครับ ช่วยดูให้หน่อยครับผม



 

ผมเอา source code จากเพจนี้มาใช้ แต่ทำไม ฟังก์ชันมาไม่ครบก็ไม่รู้ครับ ช่วยดูให้หน่อยครับผม

 



Topic : 103487

Guest




http://mrhack.sinaapp.com/static/codecanyon/selectBeautify/index.html



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-12-11 13:36:31 By : หมูน้อย View : 853 Reply : 3
 

 

No. 1



โพสกระทู้ ( 3,844 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Twitter Facebook

ไป copy มา แล้วเอาของเค้ามาครบรึเปล่า ดูดีๆ ใช้ google chrome debug ดูก็ได้ ง่ายกว่าไปเดาเอาว่ามัน error อะไร

Code (PHP)
      <script type="text/javascript" src="js/jquery-1.4.4.js" ></script>
      <script type="text/javascript" src="js/jquery-selectBeautify.js" ></script>
      <link rel="stylesheet" href="css/selectBeautify.css" type="text/css" />


Code (JavaScript)
        $('#demo-select').selectBeautify({
            height: 26,
            width: 150,
            className: 'beauty-select-v'
        });







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-12-11 13:50:54 By : mangkunzo
 


 

No. 2

Guest


ตอบความคิดเห็นที่ : 1 เขียนโดย : mangkunzo เมื่อวันที่ 2013-12-11 13:50:54
รายละเอียดของการตอบ ::
คิดว่าครบนะครับ แต่ยังไม่ได้เลยครับผม

Code (PHP)
<html><head>
  <title>select beautify </title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="Author" content="CH">
  <meta name="Keywords" content=" select beautify ">
  <meta name="Description" content="select beautify ">
  <script type="text/javascript" src="http://mrhack.sinaapp.com/static/codecanyon/selectBeautify/js/jquery-1.4.4.js"></script>
  <script type="text/javascript" src="http://mrhack.sinaapp.com/static/codecanyon/selectBeautify/js/jquery-selectBeautify.js"></script>
  <link rel="stylesheet" href="http://mrhack.sinaapp.com/static/codecanyon/selectBeautify/css/selectBeautify.css" type="text/css">
  <style type="text/css">
    body{
        background:url('image/bg.png');
        color:#fff;
        font-size:16px;
        font-family:"Segoe UI",Tahoma,Arial,Helvetica,sans-serif;
    }
    pre{margin:0;padding:0;}
    .container{width:960px;margin:0 auto;}
    .container .header{
        text-align:center;
        line-height:40px;
        padding:20px;
        text-shadow: 2px 2px 0 transparent, 4px 4px 0 #101010;
        font-weight: bold;
        font-size: 38px;
        font-family: "Terminal Dosis", sans-serif;;
    }
    .container .header em{
        float:right;
        font-size:20px;
    }
    .container .wrap ,.container .select-maker , .container .footer{
        border-radius: 10px;
        color: #333;
        background-color: #fff;
        padding: 20px;
        margin-bottom:20px;
    }

    .container .select-maker dl{float:left;width:400px;}
    .container .select-maker dd{margin:10px;clear:both;}
    .container .select-maker dd .l{float:left;width:200px;}
    .container .select-maker dd input ,.container .select-maker dd select{height:26px;line-height:26px;}
    .wrap dl{clear:both;height:30px;margin-bottom:20px;}
    .wrap dt , .wrap dd{float:left; width:200px;}
    .wrap .view-code{width:50px;float:right;cursor:pointer;color:blue;}
    .wrap .code{clear:both;float:none;display:none;background:#ccc;border-radius:5px;width:100%;}
    .clearfix::after {
        content: ".";
        display: block;
        height: 0;
        visibility: hidden;
        clear: both;
        }
    h2{margin-bottom:10px;}
  </style>
 </head>

 <body>
    <div class="container">
        
        
        <div class="wrap">
            
            <ol>
                <li>1. Include js and css file of jQuery and BeautySelect plugin like this.<br>
    <pre>    <font face="Consolas">
    <font color="#000000">  </font><font color="#0000ff">&lt;script </font><font color="#ff0000">type</font><font color="#0000ff">=</font><font color="#ff00ff">"text/javascript" </font><font color="#ff0000">src</font><font color="#0000ff">=</font><font color="#ff00ff">"js/jquery-1.4.4.js" </font><font color="#0000ff">&gt;&lt;/script&gt;</font>
    <font color="#000000">  </font><font color="#0000ff">&lt;script </font><font color="#ff0000">type</font><font color="#0000ff">=</font><font color="#ff00ff">"text/javascript" </font><font color="#ff0000">src</font><font color="#0000ff">=</font><font color="#ff00ff">"js/jquery-selectBeautify.js" </font><font color="#0000ff">&gt;&lt;/script&gt;</font>
    <font color="#000000">  </font><font color="#0000ff">&lt;link </font><font color="#ff0000">rel</font><font color="#0000ff">=</font><font color="#ff00ff">"stylesheet" </font><font color="#ff0000">href</font><font color="#0000ff">=</font><font color="#ff00ff">"css/selectBeautify.css" </font><font color="#ff0000">type</font><font color="#0000ff">=</font><font color="#ff00ff">"text/css" </font><font color="#0000ff">/&gt;</font>
    </font>
    </pre>

                </li>
                <li>2. With select element in document. <br>
    <pre>    <font face="Consolas">
    <font color="#0000ff">&lt;select&gt;</font>
    <font color="#000000">    </font><font color="#0000ff">&lt;option&gt;</font><font color="#000000">Friends</font><font color="#0000ff">&lt;/option&gt;</font>
    <font color="#000000">    </font><font color="#0000ff">&lt;option </font><font color="#ff0000">disabled</font><font color="#0000ff">&gt;</font><font color="#000000">Family</font><font color="#0000ff">&lt;/option&gt;</font>
    <font color="#000000">    </font><font color="#0000ff">&lt;option </font><font color="#ff0000">selected</font><font color="#0000ff">=</font><font color="#800080">true</font><font color="#0000ff">&gt;</font><font color="#000000">Acquaintances</font><font color="#0000ff">&lt;/option&gt;</font>
    <font color="#000000">    </font><font color="#0000ff">&lt;option&gt;</font><font color="#000000">stranger</font><font color="#0000ff">&lt;/option&gt;</font>
    <font color="#000000">    </font><font color="#0000ff">&lt;option&gt;</font><font color="#000000">Notifications</font><font color="#0000ff">&lt;/option&gt;</font>
    <font color="#0000ff">&lt;/select&gt;</font>
    </font>
    </pre>
                </li>
                <li>3. Use plugin to init select element. <br>
    <pre>    <font face="Consolas">
        <font color="#800000">$(</font><font color="#ff00ff">'#demo-select'</font><font color="#800000">).selectBeautify({</font>
            <font color="#800000">height: </font><font color="#800080">26</font><font color="#800000">,</font>
            <font color="#800000">width: </font><font color="#800080">150</font><font color="#800000">,</font>
            <font color="#800000">className: </font><font color="#ff00ff">'beauty-select-v'</font>
        <font color="#800000">});</font>
    </font>
    </pre>

                </li>
                <li>3. This is the result. <br>
<div style="padding: 10px 60px;">
    original select : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<select>
        <option>Friends</option>
        <option disabled="">Family</option>
        <option selected="true">Acquaintances</option>
        <option>stranger</option>
        <option>Notifications</option>
    </select>
</div>
<div style="padding: 10px 60px;">
    result with plugin: &nbsp;&nbsp;&nbsp;
    <div class="beauty-select-plugin beauty-select-v beauty-select-hover" style="vertical-align: middle; display: inline-block; width: 150px; line-height: 24px; zoom: 1; z-index: 0; position: static;"><div class="beauty-select-curr" style="height: 24px;"><a href="javascript:void(0);" hidefocus="true" class="beauty-select-sprite"></a><label title="Notifications" style="padding-left: 3px; width: 98px; overflow: hidden;">Notifications</label></div><div class="beauty-select-list" style="position: absolute; left: 0px; zoom: 1; z-index: 1; cursor: default; height: 0px; width: 148px; display: none; bottom: 26px; overflow-x: hidden; overflow-y: visible;"><ul style="width: 100%; position: absolute; height: 120px; overflow-y: auto; overflow-x: hidden; top: 0px;"><li index="0" title="" class="beauty-select-opt"><label>Friends</label></li><li index="1" title="" class="beauty-select-opt beauty-select-opt-disabled" disabled="disabled"><label>Family</label></li><li index="2" title="" class="beauty-select-opt"><label>Acquaintances</label></li><li index="3" title="" class="beauty-select-opt"><label>stranger</label></li><li index="4" title="" class="beauty-select-opt hover"><label>Notifications</label></li></ul></div></div><select id="demo-select" style="display: none;">
    <option>Friends</option>
    <option disabled="">Family</option>
    <option selected="true">Acquaintances</option>
    <option>stranger</option>
    <option>Notifications</option>
</select>
<script language="javascript">
<!--
    $('#demo-select').selectBeautify({
        height: 26,
        width: 150,
        className: 'beauty-select-v'
    });
//-->
</script>
</div>

                </li>
            </ol>

    

        </div>
        
        
        
        
    </div>
    <script type="text/javascript">
    <!--
        $(function(){

            var getFormData = function($form){
                var f = $form.get(0),
                    result = {};
                $form.find('input,textarea,select').each(function(i , item){
                    var name = item.name,
                        val = item.value;
                    val = $(item).val() == $(item).attr('default-value')? '' : val;
                    if(item.tagName.toLowerCase() == 'input'){
                        switch(item.type){
                            case 'text':
                                result[name] = val;
                                break;
                            case 'checkbox':
                                if(item.checked){
                                    result[name] = result[name]? result[name] + ',' + val : val;
                                }
                                break;
                            case 'radio':
                                if(item.checked){
                                    result[name] = val;
                                }
                        }
                    }else{
                        result[name] = val;
                    }
                });
                return result;
            };
            $('#s1').selectBeautify({
                height: 26
            }).change(function(){
                $(this).closest('dl').find('.desc').html('You have selected ' + $(this).val());
            }).appendTo($('#s1').parent().prev()).show();
            

            $('#s2').selectBeautify({
                height: 26,
                width: 150,
                className: 'beauty-select-triangle'
            }).change(function(){
                $(this).closest('dl').find('.desc').html('You have selected ' + $(this).val());
            }).appendTo($('#s2').parent().prev()).show();
            

            $('#s3').selectBeautify({
                        
                height: 26, // set the height of wrap
                width: 180, // set wrap width
                imageWidth: 18, // set image width
                imageHeight: 12, // set image height
                withImage: true, // this means there is a backgroun image for options
                maxHeight: 150, // set max height of list wrap
                className: 'beauty-select-v' // style
            }).change(function(){
                $(this).closest('dl').find('.desc').html('You have selected ' + $(this).val());
            }).appendTo($('#s3').parent().prev()).show();


            $('.view-code').click(function(){
                var $next = $(this).closest('dl').next();
                if($next.length){
                    $next.slideToggle(400);
                }
            });

            $('#reset').click(function(){
                var data = getFormData($('#form-data')),
                    digit = /^\s*(\d+)\s*$/,
                    value;
                for(var key in data){
                    value = data[key];
                    if(digit.test(value)){
                        value = parseInt(value.match(digit)[1]);
                    }
                    data[key] = value;
                }
                $('#s4').selectBeautify(data);
            });
        });
    //-->
    </script>
 

</body></html>



แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-12-11 13:55:35 By : หมูน้อย
 

 

No. 3



โพสกระทู้ ( 3,844 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Twitter Facebook

ตอบความคิดเห็นที่ : 2 เขียนโดย : หมูน้อย เมื่อวันที่ 2013-12-11 13:55:35
รายละเอียดของการตอบ ::
debug ดูด้วยครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-12-11 14:02:13 By : mangkunzo
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ผมเอา source code จากเพจนี้มาใช้ แต่ทำไม ฟังก์ชันมาไม่ครบก็ไม่รู้ครับ ช่วยดูให้หน่อยครับผม
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่