3

I have an iframe which has a settings button, whose button I have appended through a javascript like-

headerFuncPanel.append( "<div title='settings button' class='settingsImg window_icon_button no-draggable'></div>" );

Now, I have to add to it a simple dropdown menu - so that onClick of the settings button, I get a dropdown menu.

I have to include the following bit of code in form of a menu-

<ul>
<li><a href="#">Apples</a></li>
<li><a href="#">Oranges</a></li>
<li><a href="#">Bananas</a></li>
<li><a href="#">Cheetos</a></li>
</ul>

Is there any way I can insert/add this menu list in the append function or add the same list through

headerFuncPanel.children(".settingsImg").click(function() {};

How can I add the menu html through javascript?

4

1 に答える 1

0

変数の周りに $() を追加しようとしましたか?

お気に入り:

$(headerFuncPanel.children(".settingsImg")).click(function() {}; 

または単に .append メソッドの後にイベントを追加します:

headerFuncPanel.append(...);
$('.settingsImg').click(...);
于 2012-06-08T08:56:39.783 に答える