-1

Possible Duplicate:
How can change a styling of javascript alert button?

Just wondering if there is any way to style popup boxes?

"UPDATE"

This is the actual code which is creating alerts. If I use jQuery dialog then what will be form of the code? I mean How jQuery's code will be inserted with this code? Thanks

<?php 
// Start YOURLS engine
require_once( '../y/includes/load-yourls.php' );

function selfURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s; $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; } function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }
?>

    <?php
    // Part to be executed if FORM has been submitted
    if ( isset($_REQUEST['url']) ) {
        $url     = yourls_sanitize_url( $_REQUEST['url'] );
        $return  = yourls_add_new_link( $url );     
        $shorturl = isset( $return['shorturl'] ) ? $return['shorturl'] : '';        
        echo "<script type='text/javascript'>alert('$shorturl')</script>";

    // Part to be executed when no form has been submitted
    }   
        $site = YOURLS_SITE;
        $var = selfURL();
?> 
Community
  • 1
  • 1
Taimoor
  • 63
  • 2
  • 10

2 Answers2

0

If, by "popup box", you mean the native dialogs generated by alert(), confirm() and similar — no, there isn't.

If the appearance of them is that important, then you will need to generate DOM elements, bind event handlers to replicate the functionality of the buttons, and style them instead.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

If you mean alert, prompt or something else which is built-in - no you cant set them a custom styles, they use the default browser style.

If you want a custom style you need JavaScript window plugin. Some UI libraries which provides window widgets are jQuery UI, jQWidgets, Kendo UI, Sencha, etc...

Here are few examples:

jqxWindow by jQWidgets

enter image description here

jQuery UI dialog

enter image description here

Minko Gechev
  • 25,304
  • 9
  • 61
  • 68