开发者

Easiest Jquery/Javascript hover window?

开发者 https://www.devze.com 2023-03-04 11:11 出处:网络
I\'m looking for the easiest solution, preferably integrated with Jquery, for opening a div / url in a hover windo开发者_开发百科w (javascript window). Any suggestions?I find jQuery UI pretty easy, sp

I'm looking for the easiest solution, preferably integrated with Jquery, for opening a div / url in a hover windo开发者_开发百科w (javascript window). Any suggestions?


I find jQuery UI pretty easy, specifically the Dialog widget.

HTML:

<div id="myDialog" title="Basic dialog">
    <p>This is the default dialog.
       The dialog window can be moved, resized and
       closed with the 'x' icon.</p>
</div>

JavaScript (once the DOM is loaded):

$("#myDialog").dialog({autoOpen: false});

Then to open it:

$("#myDialog").dialog('open');

It has its own close button, or you can close it:

$("#myDialog").dialog('close');
0

精彩评论

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