Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 2.18 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Colorbox opens at the wrong size, then shrinks to correct size
  2. $(function(){
  3.                         $('#notifyFormLink').colorbox({
  4.                                 width:300,
  5.                                 height:270,
  6.                                 opacity:0,
  7.                                 transition:"none",
  8.                                 scrolling:false,
  9.                                 onComplete: function() {
  10.                                     notifySubmit();
  11.                                 }}); // end colorbox
  12.                     }); // end anon function                        
  13.  
  14.                     function notifySubmit() {
  15.                         // $.colorbox.resize();
  16.                         $('#emailNotify').focus();
  17.                         $("#notifyForm").submit(function(){
  18.                             var input = $('#emailNotify').val();
  19.                             if (input.match(/^[wd.+]+@[wd.+]+$/)) {
  20.                                 $.get(
  21.                                     $(this).attr('action'),
  22.                                     $(this).serialize(),
  23.                                     function(data){
  24.                                         $().colorbox({
  25.                                             html: data,
  26.                                             width:300,
  27.                                             height:270,
  28.                                             opacity:0,
  29.                                             transition:"none",
  30.                                             scrolling:false,
  31.                                             onComplete: function() {
  32.                                                 notifySubmit();
  33.                                                 }});
  34.                                             } // end data
  35.                                         ); // end get
  36.                                         return false;
  37.                             } else {
  38.                                 $('#validationResponse').html('<span style="font-size:12px">Bad e-mail: please try again.</span>');
  39.                                 return false;      
  40.                             }
  41.                          }); // end submit
  42.                     } // end notifySubmit