-1

我试图获取一个图像(cookie 策略),一旦单击该图像,就会显示一个对话框,通知该网站上使用了 cookie。我希望使用 jQuery 对话框,但似乎很难。

演示链接: http: //myfirststepsto.weebly.com/

我想使用的 jQuery:http: //jqueryui.com/dialog/#default

<div id="oneout">
<span class="onetitle">

</span>
<div id="oneout_inner">
<centre>

<img src="https://dl.dropboxusercontent.com/u/89687987/mycookie.png"  alt="cookie policy" />
</a>

<br></center></div></div>
4

1 回答 1

3

我为你做了一个小提琴希望它有帮助! jsFiddle在这里

HTML:

<div id="oneout">
    <span class="onetitle"></span>
    <div id="oneout_inner">
        <center>
            <a><img id="opener" src="https://dl.dropboxusercontent.com/u/89687987/mycookie.png"  alt="cookie policy" /></a>
            <br>
        </center>
    </div>
</div>
<div id="dialog" title="Basic dialog">
    <p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

Javascript:

$(function() {
    $( "#dialog" ).dialog({
        autoOpen: false,
        show: {
            effect: "blind",
            duration: 1000
        },
        hide: {
            effect: "explode",
            duration: 1000
        }
    });
    $( "#opener" ).click(function() {
        $( "#dialog" ).dialog( "open" );
    });
});
于 2013-05-22T12:54:09.577 回答