twitter-bootstrap
  • tooltip
  • 2013-06-05 7 views -1 likes 
    -1

    여기에 제 HTML이 있습니다. 모든 파일을 포함했지만 ....부트 스트랩 툴팁이 작동하지 않습니다.

    <link rel="stylesheet" href="css/bootstrap.css"> 
    <link rel="stylesheet" href="css/main.css"> 
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js'></script> 
    <script src="js/bootstrap.js"></script> 
    </head> 
    
    <a href="#" id="tip" data-toggle="popover" data-placement="right" title="first tooltip">hover over me</a> 
    
    <script> 
    $function() { 
    $('#tip').popover('show'); 
    }); 
    </script> 
    
    </body> 
    </html> 
    

    어디서 오류가 있습니까? 는

    답변

    2

    스크립트가 여는 괄호가 누락 감사 :

    <script type="text/javascript"> 
        $(function() { // missing the opening bracket 
        $('#tip').popover('show'); 
        }); 
    </script> 
    

    편집

    있는 HTML이 중 하나를 완전히 정확하지 않았다. 아래 코드는 나를 위해 작동합니다. 그리고 jsfiddle도 작동한다는 것을 증명해야합니다 :-)

    <html> 
    <head> 
        <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> 
    
        <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js'></script> 
        <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> 
    </head> 
    <body> 
        <a href="#" id="tip" data-toggle="popover" data-placement="right" title="first tooltip">hover over me</a> 
    
        <script> 
         $(function() { 
          $('#tip').popover('show'); 
         }); 
        </script> 
    
    </body> 
    </html> 
    
    +1

    정확합니다. :) – frogcoder

    +0

    감사하지만 작동하지 않습니다 – budo

    +0

    내 답변에 자세한 내용을 추가했습니다. –

    관련 문제