Click here to Skip to main content
15,895,709 members
Articles / Web Development / HTML

Using GreyBox Popup Window in asp.net

Rate me:
Please Sign up or sign in to vote.
4.90/5 (9 votes)
16 Jan 2012CPOL4 min read 104.5K   10.8K   42  
Simple JavaScript popup window that doesn't suck and easy to use.
var tmpl_header = AJS.join('', [
    '<div id="top"> <img src="static_files/logo.gif" alt="" /> <br />',
    '<span style="font-weight: bold; color: #333">A pop-up window that doesn\'t suck.</span>',
    '</div>'
]);

function insertHeader() {
    AJS.DI(tmpl_header);
}

var LINKS = {
    'installation': 'installation.html',
    'examples': 'examples.html',
    'nrm_usage': 'normal_usage.html',
    'adv_usage': 'advance_usage.html',
    'cmpr': 'compressing_greybox.html',
    'about': 'about.html'
}

function insertMenu(current_page) {
    var menu = AJS.UL({id: 'menu'});
    var create_item = function(cls, name) {
        var item = AJS.LI({'class': cls});
        AJS.ACN(item, AJS.A({href: LINKS[cls]}, name));
        return item;
    }
    var items = [
        create_item('installation', 'Installation'),
        create_item('examples', 'Examples'),
        create_item('nrm_usage', 'Normal usage'),
        create_item('adv_usage', 'Advance usage'),
        create_item('cmpr', 'Compressing GreyBox'),
        create_item('about', 'About')
    ];

    AJS.map(items, function(item) {
        if(item.className == current_page) {
            AJS.addClass(AJS.$bytc('a', null, item)[0], 'current');
        }
        AJS.ACN(menu, item);
    });
    AJS.DI(menu);
}

function insertCode() {
    var code = AJS.join('\n', arguments);
    var result = '<pre><code>';
    code = code.replace(/</g, '&lt;').replace(/>/g, '&gt;');
    result += code;
    result += '</code></pre>';
    document.write(result);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead iFour Technolab Pvt Ltd
India India
Working with a leading custom software development company, iFour Technolab Pvt. Ltd.

Comments and Discussions