开发者

Call JQuery Function OnClick

I know this question looks very similar to other questions on this site but I'm in a particular situation and I can't for the life of me figure out how to get this to work. Perhaps it's simple but I can't figure it out. This is my basic dialog function that I want to call onclick with an "a" tag:

<script>
     $('<iframe src="hyperlink" id="tag" frameBorder="0" width="98%" />').dialog({
          autoOpen:fal开发者_StackOverflow社区se,
          title: 'Documents',
          modal:true,
          autoResize:true,
          resizable:false,
          width: 900,
          height: 400,
          draggable:false,
          open: function(){
               $(this).css('width','98%'
               );
          }
     });

I know using iframes isn't preferable but there's a very specific reason that this is the only way it will work. Apart from that, how could I get a tex to call this dialog box onclick?


This should work

$("a#thelink").click(function(){
   $("#tag").dialog('open');
});

where thelink is the ID of your link.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜