RocketRud
05-20-2008, 06:38 PM
Here is the code that currently expands to the right
Here is the code I have. The image currently expands to the right. I need it to expand to the left on mouse over. Any help would be greatly appreciated.
var expandCollapseIncrement = 30;
var expandCollapseEveryMs = 5;
var isExpanding = false;
var isCollapsing = false;
function expandFrame() {
isCollapsing = false;
isExpanding = true;
setTimeout(doExpand, 250);
}
function doExpand() {
try {
if (!isExpanding) {
return;
}
var fl = document.getElementById("adframe");
var w = parseInt(fl.style.width);
w += expandCollapseIncrement;
if (w <= 500) {
fl.style.width = w + "px";
setTimeout(doExpand, expandCollapseEveryMs);
} else {
isExpanding = false;
}
} catch(e) {
alert("Error expanding: " + e.description);
}
}
function collapseFrame() {
isExpanding = false;
isCollapsing = true;
doCollapse();
}
function doCollapse() {
try {
if (!isCollapsing) {
return;
}
var fl = document.getElementById("adframe");
var w = parseInt(fl.style.width);
w -= expandCollapseIncrement;
if (w >= 300) {
fl.style.width = w + "px";
setTimeout(doCollapse, expandCollapseEveryMs);
} else {
isCollapsing = false;
}
} catch(e) {
alert("Error expanding: " + e.description);
}
}
document.write("<table cellspacing=\"0\" cellpadding=\"0\"><tr><td><iframe id=\"adframe\" frameborder=\"0\" scrolling=\"no\" style=\"position: absolute; z-index: 9999; width: 300px; height:250px; background-color: #FFF; border: #000 1px solid;\" src=\"banner.html\" onMouseOver=\"expandFrame();\" onMouseOut=\"collapseFrame();\"></iframe><div style=\"width: 300px; height:250px; margin-left:200px; \"></div>");
document.write("</td></tr></table>");
The banner.html file currently just has this in it:
<body style="margin: 0px;">
<div id="body_c">
<div id="banner" style="padding: 0px; margin: 0px;"></div>
<img src="1000067.jpg">
</div>
</body>
Here is the code I have. The image currently expands to the right. I need it to expand to the left on mouse over. Any help would be greatly appreciated.
var expandCollapseIncrement = 30;
var expandCollapseEveryMs = 5;
var isExpanding = false;
var isCollapsing = false;
function expandFrame() {
isCollapsing = false;
isExpanding = true;
setTimeout(doExpand, 250);
}
function doExpand() {
try {
if (!isExpanding) {
return;
}
var fl = document.getElementById("adframe");
var w = parseInt(fl.style.width);
w += expandCollapseIncrement;
if (w <= 500) {
fl.style.width = w + "px";
setTimeout(doExpand, expandCollapseEveryMs);
} else {
isExpanding = false;
}
} catch(e) {
alert("Error expanding: " + e.description);
}
}
function collapseFrame() {
isExpanding = false;
isCollapsing = true;
doCollapse();
}
function doCollapse() {
try {
if (!isCollapsing) {
return;
}
var fl = document.getElementById("adframe");
var w = parseInt(fl.style.width);
w -= expandCollapseIncrement;
if (w >= 300) {
fl.style.width = w + "px";
setTimeout(doCollapse, expandCollapseEveryMs);
} else {
isCollapsing = false;
}
} catch(e) {
alert("Error expanding: " + e.description);
}
}
document.write("<table cellspacing=\"0\" cellpadding=\"0\"><tr><td><iframe id=\"adframe\" frameborder=\"0\" scrolling=\"no\" style=\"position: absolute; z-index: 9999; width: 300px; height:250px; background-color: #FFF; border: #000 1px solid;\" src=\"banner.html\" onMouseOver=\"expandFrame();\" onMouseOut=\"collapseFrame();\"></iframe><div style=\"width: 300px; height:250px; margin-left:200px; \"></div>");
document.write("</td></tr></table>");
The banner.html file currently just has this in it:
<body style="margin: 0px;">
<div id="body_c">
<div id="banner" style="padding: 0px; margin: 0px;"></div>
<img src="1000067.jpg">
</div>
</body>