Create a dialog box in the lower right corner of JQuery

Source: Internet
Author: User

The pop-up window in the lower right corner is widely used on the Internet. Although this method will greatly affect the user experience, we still have to do this if the leaders have this requirement. The following is an example of a newly written pop-up window. Scroll: Keep it at the bottom of the right side of the page while resize: Keep it at the bottom of the right side of the page when the browser changes.

Effect demonstration

Shows the effect in the lower-right corner.

Jquery Code:

<script type="text/javascript">$(function(){    $(window).load(function(){        $("div[id=newnotice]").css({"right":"0px","bottom":"1px"});        $("div[id=newnotice]").slideDown("slow");    }).scroll(function(){        $("div[id=newnotice]").css({"bottom":"0px"});        $("div[id=newnotice]").css({"right":"0px","bottom":"1px"});    }).resize(function(){        $("div[id=newnotice]").css({"bottom":""});        $("div[id=newnotice]").css({"right":"0px","bottom":"1px"});       });       $("label[id=tomin]").click(function(){        $("div[id=noticecon]","div[id=newnotice]").slideUp();    });       $("label[id=tomax]").click(function(){        $("div[id=noticecon]","div[id=newnotice]").slideDown();    });       $("label[id=toclose]").click(function(){        $("div[id=newnotice]").hide();    });    /**$.get("http://www.bkjia.com/cgi/test.xml", function(data){$(data).find('channel').find('item').each(function(index, ele){var titles = $(ele).find('title').text();var links = $(ele).find('link').text();$("#noticecon").find('ol').append('<li><a href="'+links+'">'+titles+'</a></li>');})});    **/});</script>

HTML Code:

<Div id = "newnotice"> <p> <span class = "title"> top news </span> <span id = "bts"> <label class = "button" id = "tomin" title = "minimized" >_</label> <label class = "button" id = "tomax" title = "maximized"> port </label> <label class = "button" id = "toclose" title = "close"> × </label> </span> </p> <div id = "noticecon"> <ol> </ol> </div>

Hottest news ×

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.