2 Attachment(s)
Relocate and resize web links when using zoom in and out.
I
Code:
// Left side
function GoSizeLeft(page) {
var rel = $("#Page-" + page).attr("OrigDem").split(',');
var width = $("#Page-" + page.toString()).width();
var height = $("#Page-" + page.toString()).height();
var OrigWidth = parseFloat(rel[0]);
var OrigHeight = parseFloat(rel[1]);
var HChange = height / OrigHeight;
var WChange = width / OrigWidth;
$(LeftHotLinks).each(function () {
var relCoords = $(LeftHotLinks).attr("rel");
var arryCoords = relCoords.split(",");
//Orginal Values
var OrgX = arryCoords[0];
var OrgY = arryCoords[1];
var OrgW = arryCoords[2];
var OrgH = arryCoords[3];
//Calculate new values
var newLeft = OrgX * WChange;
var newTop = OrgY * HChange;
var NewWidth = OrgW * WChange;
var NewHeight = OrgH * HChange;
$("#Page-" + page.toString()).append($(this).css("left", newLeft.toString() - 50 + "px", "top", newTop.toString() + "px"));
});
}
image without code.Attachment 15097
with code:
Attachment 15099
With the code I can get the link to move but the move on top of each other.