Changeset 626301
- Timestamp:
- 11/16/2012 09:50:09 PM (13 years ago)
- Location:
- responsive-image-maps/trunk
- Files:
-
- 3 edited
-
jquery.rwdImageMaps.min.js (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
responsive-image-maps.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
responsive-image-maps/trunk/jquery.rwdImageMaps.min.js
r609515 r626301 1 1 /* 2 * rwdImageMaps jQuery plugin v1. 32 * rwdImageMaps jQuery plugin v1.4 3 3 * 4 4 * Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize … … 9 9 * Licensed under the MIT license 10 10 */ 11 ;(function(a){a.fn.rwdImageMaps=function(){var d=this,c=parseFloat(a.fn.jquery);var b=function(){d.each(function(){if(typeof(a(this).attr("usemap"))=="undefined"){return}var f=this,e=a(f);a("<img />").load(function(){var i,k,l="width",g="height";if(c<1.6){i=f.getAttribute(l),k=f.getAttribute(g)}else{i=e.attr(l),k=e.attr(g)}var j=e.width()/100,n=e.height()/100,m=e.attr("usemap").replace("#",""),o="coords";a('map[name="'+m+'"]').find("area").each(function(){var r=a(this);if(!r.data(o)){r.data(o,r.attr(o))}var q=r.data(o).split(","),p=new Array(q.length);for(var h=0;h<p.length;++h){if(h%2===0){p[h]=parseInt(((q[h]/i)*100)*j)}else{p[h]=parseInt(((q[h]/k)*100)*n)}}r.attr(o,p.toString())})}).attr("src",e.attr("src"))})};a(window).resize(b).trigger("resize");return this}})(jQuery);11 ;(function(a){a.fn.rwdImageMaps=function(){var d=this,c=parseFloat(a.fn.jquery);var b=function(){d.each(function(){if(typeof(a(this).attr("usemap"))=="undefined"){return}var f=this,e=a(f);a("<img />").load(function(){var o,k,i="width",n="height";if(c<1.6){o=f.getAttribute(i),k=f.getAttribute(n)}else{o=e.attr(i),k=e.attr(n)}if(!o||!k){var p=new Image();p.src=e.attr("src");if(!o){o=p.width}if(!k){k=p.height}}var g=e.width()/100,l=e.height()/100,j=e.attr("usemap").replace("#",""),m="coords";a('map[name="'+j+'"]').find("area").each(function(){var s=a(this);if(!s.data(m)){s.data(m,s.attr(m))}var r=s.data(m).split(","),q=new Array(r.length);for(var h=0;h<q.length;++h){if(h%2===0){q[h]=parseInt(((r[h]/o)*100)*g)}else{q[h]=parseInt(((r[h]/k)*100)*l)}}s.attr(m,q.toString())})}).attr("src",e.attr("src"))})};a(window).resize(b).trigger("resize");return this}})(jQuery); -
responsive-image-maps/trunk/readme.txt
r609524 r626301 5 5 Donate link: http://philipnewcomer.net/donate/ 6 6 Tags: responsive, image map, image, map, jquery, jquery plugin 7 Version: 1. 28 Stable tag: 1. 27 Version: 1.3 8 Stable tag: 1.3 9 9 Requires at least: 3.0 10 Tested up to: 3.4. 110 Tested up to: 3.4.2 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 16 16 == Description == 17 17 18 I'm not a big fan of image maps, but there are times when they do have legitimate uses. This plugin simply packages the [RWD Image Maps](https://github.com/stowball/jQuery-rwdImageMaps) jQuery plugin for use in WordPress, providing an easy way to make image maps responsive in anyWordPress theme.18 This plugin simply packages the [RWD Image Maps](https://github.com/stowball/jQuery-rwdImageMaps) jQuery plugin for use in WordPress, providing an easy way to make image maps responsive in a WordPress theme. 19 19 20 20 This plugin is licensed under the GPLv2, and the jQuery plugin is licensed under the MIT license. … … 30 30 == Changelog == 31 31 32 = 1.3 = 33 * Updated the [RWD Image Maps jQuery plugin](https://github.com/stowball/jQuery-rwdImageMaps) to version 1.4. Images are no longer required to have width/height attributes. 34 * Updated readme.txt 35 32 36 = 1.2 = 33 37 * Updated the jQuery RWD Image Maps plugin to version 1.3, which adds IE8 support: https://github.com/stowball/jQuery-rwdImageMaps/pull/7 … … 40 44 * Initial release 41 45 42 == Implementation ==43 44 Your image map needs to keep the original width and height attributes in the HTML markup for the RWD Image Maps jQuery plugin to function properly. However, the *Responsive Image Maps* WordPress plugin will add the CSS styles `max-width: 100%; height: auto;` to all image maps, which will override the HTML width and height attributes for the image map's display. That will make the image maps responsive while allowing the RWD Image Maps jQuery plugin to function properly.45 46 46 == Javascript Warning == 47 47 -
responsive-image-maps/trunk/responsive-image-maps.php
r609516 r626301 3 3 Plugin Name: Responsive Image Maps 4 4 Plugin URI: http://philipnewcomer.net/wordpress-plugins/responsive-image-maps/ 5 Description: Makes image maps responsive by packaging the RWD Image Maps jQuery plugin for use in WordPress 6 Version: 1. 25 Description: Makes image maps responsive by packaging the RWD Image Maps jQuery plugin for use in WordPress. 6 Version: 1.3 7 7 Author: Philip Newcomer 8 8 Author URI: http://philipnewcomer.net … … 28 28 function pn_rim_enqueue_scripts() 29 29 { 30 wp_enqueue_script( 'jQuery.rwd_image_maps', plugins_url( 'jquery.rwdImageMaps.min.js', __FILE__ ), array( 'jquery' ), '1. 3', true );30 wp_enqueue_script( 'jQuery.rwd_image_maps', plugins_url( 'jquery.rwdImageMaps.min.js', __FILE__ ), array( 'jquery' ), '1.4', true ); 31 31 } 32 32 add_action( 'wp_enqueue_scripts', 'pn_rim_enqueue_scripts' );
Note: See TracChangeset
for help on using the changeset viewer.