質問

Chrome ブラウザ アクションは、デフォルトで非常に優れたポップアップ効果を提供します。

死んだImageShack画像リンクが削除されました

  • ツールバー アイコンの上にマウスを置くと、きちんとしたホバー効果が得られます。

  • ツールバーのアイコンをクリックすると、ポップアップ HTML ファイルを開く素晴らしいアニメーションが表示されます。

  • ポップアップは押されたボタンに合わせて表示されます。

  • ツールバーのアイコンをもう一度クリックすると、ポップアップがフェードアウトします。

Firefox 拡張機能を使用してこの効果に近づける方法について何か考えはありますか?この効果と同様の効果を達成した人はいますか?

ありがとう。

役に立ちましたか?

解決 2

はケースで誰もがこれを調査し、最終的にはbrowser.xulファイルにはtoolbarpalette内パネルを使用して、答えを見つけるためにしようとしているが私のためによく働いています。

他のヒント

私はここで行ったように、ちょうどあなたの最初のFirefoxの拡張機能で始まっている誰もがサンプルコードであるために

のyourextnameの\クローム\コンテンツ\ browser.xulです

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://yourextname/skin/toolbar.css" type="text/css"?>

<overlay id="yourextname_overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <popupset>
        <menupopup id="yourextname_menu_popup">
            <menuitem label="Website" oncommand="gBrowser.selectedTab = gBrowser.addTab('http://www.your-website.com/');" />
            <menuseparator />
            <menuitem label="Options" oncommand="window.open('chrome://yourextname/content/options.xul', 'Options', 'dialog,chrome,modal,titlebar,toolbar,centerscreen=yes');" />
        </menupopup>

        <panel id="yourextname_popup" noautohide="false" noautofocus="true">
            <label control="vvvname" value="Name:"/><textbox id="vvvname"/>
        </panel>
    </popupset>

    <toolbarpalette id="BrowserToolbarPalette">
        <toolbarbutton id="yourextname_toolbar_button" class="toolbarbutton-1" context="yourextname_menu_popup" oncommand="document.getElementById('yourextname_popup').openPopup(document.getElementById('yourextname_toolbar_button'), 'after_start', 0, 0, false, false);" label="button name" tooltiptext="tooltip" />
    </toolbarpalette>
</overlay>
<時間>

のyourextname \皮膚\ toolbar.css
これは、ツールバーのボタンにアイコンを追加します。

#yourextname_toolbar_button {
    list-style-image:url(chrome://yourextname/skin/icon_024.png);
}

toolbar[iconsize="small"] #yourextname_toolbar_button {
    list-style-image:url(chrome://yourextname/skin/icon_016.png);
}
<時間>

のyourextname \にchrome.manifest

content yourextname chrome/content/
overlay chrome://browser/content/browser.xul chrome://yourextname/content/overlay.xul

skin    yourextname classic/1.0 skin/
style   chrome://global/content/customizeToolbar.xul chrome://yourextname/skin/toolbar.css
<時間>

注:あなたが拡張名を持つ、最高のユニークなもので、すべての「yourextname」の文字列を置換していることを確認してください。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top