Hi, i tried draw an areas in one map, and resize the map and areas location with this scripts. If the resize work the maphiligth doens show the areas, and if a can darw the areas dont resize the map, plz help me
rwdImageMaps jQuery plugin v1.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
*
Licensed under the MIT license
*/
; (function ($) {
$.fn.rwdImageMaps = function (options) {
var settings = $.extend({
'useMaphilight': false
}, options);
var $img = this,
version = parseFloat($.fn.jquery),
backgroundSize = 'background-size',
webkit = '-webkit-' + backgroundSize,
cover = 'cover';
var rwdImageMap = function () {
$img.each(function () {
if (typeof ($(this).attr('usemap')) == 'undefined')
return;
var that = this,
$that = $(that);
// Since WebKit doesn't know the height until after the image has loaded, perform everything in an onload copy
$('<img />').load(function () {
var w,
h,
attrW = 'width',
attrH = 'height';
// jQuery < 1.6 incorrectly uses the actual image width/height instead of the attribute's width/height
if (version < 1.6)
w = that.getAttribute(attrW),
h = that.getAttribute(attrH);
else
w = $that.attr(attrW),
h = $that.attr(attrH);
var wPercent = $that.width() / 100,
hPercent = $that.height() / 100,
map = $that.attr('usemap').replace('#', ''),
c = 'coords';
$('map[name="' + map + '"]').find('area').each(function () {
var $this = $(this);
if (!$this.data(c))
$this.data(c, $this.attr(c));
var coords = $this.data(c).split(','),
coordsPercent = new Array(coords.length);
for (var i = 0; i < coordsPercent.length; ++i) {
if (i % 2 === 0)
coordsPercent[i] = parseInt(((coords[i] / w) * 100) * wPercent);
else
coordsPercent[i] = parseInt(((coords[i] / h) * 100) * hPercent);
}
$this.attr(c, coordsPercent.toString());
});
$(that).attr('width', $(that).width()).attr('height', $(that).height()).maphilight();
}).attr('src', $that.attr('src'));
if (settings['useMaphilight'] && $.fn.maphilight) {
$that.maphilight();
$that.parent('div').css({
webkit: cover,
backgroundSize: cover
});
}
});
};
$(window).resize(rwdImageMap).trigger('resize');
return $img;
Hi, i tried draw an areas in one map, and resize the map and areas location with this scripts. If the resize work the maphiligth doens show the areas, and if a can darw the areas dont resize the map, plz help me
Licensed under the MIT license */ ; (function ($) { $.fn.rwdImageMaps = function (options) { var settings = $.extend({ 'useMaphilight': false }, options);
}; })(jQuery);
and
(function ($) { var has_VML, has_canvas, create_canvas_for, add_shape_to, clear_canvas, shape_from_area, canvas_style, hex_to_decimal, css3color, is_image_loaded, options_from_area;
})(jQuery);
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Reservas.aspx.vb" Inherits="Procesos_Reservas" %> <%@ Register TagPrefix="eo" Namespace="EO.Web" Assembly="EO.Web" %> <!doctype html>
<%--- Elemento 1
- Elemento 1.1
- Elemento 1.2
- Elemento 1.3
- Elemento 2
- Elemento 3
- Elemento 3.1
- Elemento 3.1.1
- Elemento 3.1.2
- Elemento 3.2
- Elemento 3.3
- Elemento 4
--%>