Friday, March 19, 2010

Tuesday, September 1, 2009

Open Comments form with Highslide

The code below overrides the default browser's window.open popup and make it into a Highslide popup.

First go to Dashbord --> Setting --> Comments --> Comment form placement and check for Pop-up window.
Then go to Dashbord --> Layout --> Edit HTML and paste this between the head tags, below the included Highslide js file:
// Override the window.open method
window.open = function(url, name, options) {
   var opener, width, height, anchors;

   // locate the opener by the url
   anchors = document.getElementsByTagName('a');
   for (var i = 0; i < anchors.length; i++) {
      if (anchors[i].href == url) {
         opener = anchors[i];
         break;
      }
   }
   // get the size
   width = options.match(/width=([0-9]+)/);
   if (width) width = width[1];
   height = options.match(/height=([0-9]+)/);
   if (height) height = height[1];

   // open it
   hs.htmlExpand(opener, {
      objectType: 'iframe',
      src: url,
      width: width,
      height: height
   });
}

Sunday, August 30, 2009

Highslide onclick code in Blogger Template editor

You can’t put regular Highslide onclick code directly between the body tags in the Blogger Template editor because the Template editor will transform the ' and " to something else.
Write your code and go to this page - HTML Encoder.
Paste your code and click the Encode button. Paste the transformed code in the Template editor.

Thursday, August 27, 2009

Highslide JS - linked image

This image is using hs.isUnobtrusiveAnchor