Commits

Anonymous committed 9dc8e21

Initial commit to mtrepo

Comments (0)

Files changed (1)

masterfunctions.js

  * Project: Generic reusable functions for Adnet websites
  * Author: Rudy Affandi
  * Created: 03/19/2011
- * Revision: 11/04/2011
+ * Revision: 10/13/2011
  * File name: masterfunctions.js
- *
  */
 
 /*
 
 // jQuery initialization and CSS settings, waiting for DOM tree to initialize
 $(document).ready(function(){
+
    /*
     * jQuery-based drop down navigation
     * Dependency: jQuery
    $('a.ext_link').live('click', function(){
       var link = $(this).attr('href');
       $('<div>You are leaving ' + companyName + ' site. Do you want to proceed?</div>').dialog({
-         title: "External Link",
+         title: companyName,
          width: 400,
          modal : true,
          overlay: {
       return false;
    });
 
-/*
+   // Alert dialog box
+   $('a.coming_soon').live('click', function(){
+      $('<div>Coming soon...</div>').dialog({
+         title: companyName,
+         width: 300,
+         modal : true,
+         overlay: {
+            backgroundColor: '#000',
+            opacity: 0.5
+         },
+         buttons: {
+           'OK': function() {
+              $(this).dialog('close').remove();
+              return false;
+            }
+         }
+      });
+      return false;
+   });
+
    // Image thumbnail processing
    $('ul.image_grid_format li').each(function(){
       var _this = $(this);
          //_this.css('height', $(this).outerHeight() + 'px');
       });
    });
+
+/*
+   // Image thumbnail processing
+   $('img').load(function(){
+       var $this = $(this),
+           img_width = $this.outerWidth();
+           img_height = $this.outerHeight();
+       $this.closest('.img_thumb').css('width', img_width + 'px');
+       $this.closest('ul.image_grid_format li').css('width', img_width + 'px');
+   });
 */
 
    // Add zoom icon
    $('.img_thumb a, ul.image_grid_format li a').append('<div class="zoom">');
 
+   // Increase image rendering quality
+   //$('img').css({'image-rendering': 'optimizeQuality', '-ms-interpolation-mode': 'bicubic'});
+
 });
 
 // Deprecated since ...
    }
 };
 
+
 $(window).unload(function() {
    if (jQuery().qtip){// Check if plugin loaded
       $('area').qtip("destroy");