# Expands to Right I need Expand to left

**URL:** <https://forum.kirupa.com/t/expands-to-right-i-need-expand-to-left/260778>\
**Category:** programming\
**Created:** [May 19, 2008, 7:53pm UTC](https://forum.kirupa.com/t/expands-to-right-i-need-expand-to-left/260778 "2008-05-19T19:53:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rocketrud](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Rocketrud](https://forum.kirupa.com/u/Rocketrud)\
**Post date:** [May 19, 2008, 7:53pm UTC](https://forum.kirupa.com/t/expands-to-right-i-need-expand-to-left/260778/1 "2008-05-19T19:53:16Z")

</div>

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\>");

---

<div class="post-metadata">

**Author:** ![Rocketrud](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Rocketrud](https://forum.kirupa.com/u/Rocketrud)\
**Post date:** [May 19, 2008, 7:54pm UTC](https://forum.kirupa.com/t/expands-to-right-i-need-expand-to-left/260778/2 "2008-05-19T19:54:58Z")

</div>

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\>

---

<div class="post-metadata">

**Author:** ![Rocketrud](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Rocketrud](https://forum.kirupa.com/u/Rocketrud)\
**Post date:** [May 19, 2008, 9:03pm UTC](https://forum.kirupa.com/t/expands-to-right-i-need-expand-to-left/260778/3 "2008-05-19T21:03:49Z")

</div>

No ideas? I’m havin bad luck on these kirupa forums…

---

<div class="post-metadata">

**Author:** ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)\
**Post date:** [May 20, 2008, 12:54am UTC](https://forum.kirupa.com/t/expands-to-right-i-need-expand-to-left/260778/4 "2008-05-20T00:54:41Z")

</div>

Rock… you posted it in the wrong section… were punishing you for not posting in Client-Size the forums are clearly marked. Most questions are answered within 12 hours if posted in the right section.

I’d figure i’d tell you before you think were all a bunch of cynical people. :fab:
