Results 1 to 3 of 3

Thread: Change alert function to Lightbox???

  1. #1
    Join Date
    Oct 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Change alert function to Lightbox???

    Folks,

    How Can I change the alert(breakMessage[i]) to a LightBox with a message inside, is possible?

    Code:
    <script type="text/javascript">
    function breakTime(){ // <<< do not edit or remove this line!
    
    /* Set Break Hours in 24hr Notation */
    var breakHour=[10, 14, 15]
    
    /* Set Break Minutes */
    var breakMinute=[45, 45, 15]
    
    /* Set Break Messages */
    var breakMessage=["Test", "Test1", "Test2"]
    
    ///////////////////No Need to Edit//////////////
    var theDate=new Date()
    for (i = 0; i < breakHour.length; i++)
    if (Math.abs(theDate.getHours())==breakHour[i]&&Math.abs(theDate.getMinutes())==breakMinute[i]){
    window.focus();
    clearInterval(breakInt)
    alert(breakMessage[i])
    if (i<breakHour.length-1)
    setTimeout("breakInt=setInterval('breakTime()',58000)",120000)
    }
    }
    var breakInt=setInterval("breakTime()",58000)
    ////////////////////////////////////////////////
    </script>
    Tks
    Fabiano Magno Pechibella

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Using EasyBox:

    https://code.google.com/p/easybox/

    This works:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="styles/default/easybox.min.css" type="text/css" media="screen" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
    <script type="text/javascript" src="distrib.min.js"></script>
    <script type="text/javascript">
    function breakTime(){ // <<< do not edit or remove this line!
    
    /* Set Break Hours in 24hr Notation */
    var breakHour=[11, 14, 15]
    
    /* Set Break Minutes */
    var breakMinute=[50, 45, 15]
    
    /* Set Break Messages */
    var breakMessage=["Test", "Test1", "Test2"]
    
    ///////////////////No Need to Edit//////////////
    var theDate=new Date()
    for (i = 0; i < breakHour.length; i++)
    if (Math.abs(theDate.getHours())==breakHour[i]&&Math.abs(theDate.getMinutes())==breakMinute[i]){
    window.focus();
    clearInterval(breakInt)
    //alert(breakMessage[i])
    $('#unique_id').html(breakMessage[i]);
    $.easybox([{url: "#unique_id", caption: "Break Message"}]);
    if (i<breakHour.length-1)
    setTimeout("breakInt=setInterval('breakTime()',58000)",120000)
    }
    }
    var breakInt=setInterval("breakTime()",58000)
    ////////////////////////////////////////////////
    </script>
    </head>
    <body>
    Visible content on the page
    <div id="unique_id" style="display: none; width: 320px; height: 75px;">
    </div>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks John,

    One more time you saved me....rsrsrs

    [ ]'s
    Fabiano Magno Pechibella

Similar Threads

  1. Replies: 4
    Last Post: 02-12-2009, 01:41 AM
  2. Help change compose function
    By oriecat in forum JavaScript
    Replies: 4
    Last Post: 10-26-2008, 01:27 AM
  3. alert function using arrays
    By jc_gmk in forum JavaScript
    Replies: 4
    Last Post: 11-23-2007, 05:03 PM
  4. Sound alert on image change.
    By BlobbDobb in forum JavaScript
    Replies: 0
    Last Post: 07-31-2007, 01:00 PM
  5. alert function
    By bigboy99 in forum JavaScript
    Replies: 2
    Last Post: 11-16-2006, 09:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •