-2

こんにちは、選択した jquery プラグインに取り組んでおり、選択したプラグインのすべての要素にツールチップを追加する必要があります。選択したものを微調整しようとしましたが、良い結果は得られませんでした。誰にもアイデアはありますか?

コード:

  <div id="synonyms_div" style="height:auto;width:170px;">
     <select id="tagger-tags" class="tagger-tags" multiple style="width:150px; font:7px;" tabindex="4">
                @foreach(var tag in ViewBag.tags)
                {
                    <option id="sel-tags" value="@tag.ID" parent="@tag.PARENT_ID" style="font:6px;">
                        @tag.NAME [@tag.EL_COUNT]
                    </option>
                }               
      </select>
    </div>
<script>
$(document).ready(function () {
    jQuery(".tagger-tags").chosen({ search_contains: true });

});
 </script>
4

2 に答える 2

5

これは、他のライブラリやその他のものを使用せずに可能な解決策です...これは、少しの CSS で実現できます。

HTML:

<!--// we have to wrap the select in a span to use :after with it //-->
<span class="tooltip" title="some title for your tooltip">
<select>
    <option>Something</option>
    <option>Something Else</option>
</select>
</span>

CSS:

.tooltip:hover:after {
    position: relative;
    /* we can get the title attribute from the relevant item */
    content: "" attr(title) "";
    /* style however you want */
    border: 1px dashed black;
    top: -1.5em;
    left: 12em;
    padding: 0.5em;
}

次のようなものが表示されます。

ツールチップ付きで選択

デモ

multipleOPの要件に合わせて変更するために、文字通り選択ボックスに単語を追加しました...

デモ 2

スクリーンショット 2

于 2013-07-23T19:15:28.653 に答える
0

質問を理解しているかどうかはわかりませんが、これを使用したいとほぼ確信しています: http://jqueryui.com/tooltip/

于 2013-07-23T18:29:31.587 に答える