DavidIQ / ReIMG

phpBB extension for resizing posted images on the client side using JavaScript and a selection of lightbox-style libraries.
https://www.davidiq.com
GNU General Public License v2.0
12 stars 4 forks source link

Add an "on mouse over" feature for Highslide JS or Litebox #1

Closed DavidIQ closed 13 years ago

DavidIQ commented 14 years ago

This is the basic implementation to be replaced with an actual config option. In includes/functions.php:

     function reimg_properties()
     {
        global $config;
        return 'class="reimg" onload="reimg(this);" onerror="reimg(this);" ' . (($config['reimg_zoom'] == '_highslide') ? 'onmouseover="return hs.expand(this);" ' : '');
     }

In reimg_content.html: After hs.lang.restoreTitle = "{LA_RESTORE_TITLE}";

     hs.Expander.prototype.onMouseOut = function (sender) {
        sender.close();
     };
DavidIQ commented 14 years ago

It would be better to do in reimg.js Instead of this: if (typeof(img.addEventListener) != "undefined") // DOM { img.addEventListener("click", reimg_zoomIn, false); } else if (typeof(img.attachEvent) != "undefined") // MSIE { img.attachEvent("onclick", reimg_zoomIn); } this: if (typeof(img.addEventListener) != "undefined") // DOM { img.addEventListener("click", reimg_zoomIn, false); img.addEventListener("mouseover", reimg_zoomIn, false); } else if (typeof(img.attachEvent) != "undefined") // MSIE { img.attachEvent("onclick", reimg_zoomIn); img.attachEvent("onmouseover", reimg_zoomIn); }

Need to add a variable there to indicate it should add the listeners or not. The "onMouseOut" option needs to be researched a bit more as to placement.

DavidIQ commented 13 years ago

I don't think I like this idea afterall. Closing.