/    Sign up×
Community /Pin to ProfileBookmark

Short and sweet!

I have been having a really hard time finding anyone to help me out with this.

[url]http://mambo-templates.ty2u.com[/url]

[code]
function limit(a,b,c){
document.mmlimit=a;
document.minw=b;
document.maxw=c;
if(document.getElementById&&navigator.appVersion.indexOf(“MSIE”)>-1&&!window.opera){
if(window.attachEvent){
window.attachEvent(“onresize”,setWidth);
window.attachEvent(“onload”,setWidth);
}else{
window.onload=setWidth;
window.onresize=setWidth;
}
}
}

function setWidth(){
var curw=null,minwidth=null,maxwidth=null,theDiv=document.mmlimit;
var resizeObj=document.getElementById(theDiv);
minwidth=parseInt(document.minw, 10);
maxwidth=parseInt(document.maxw, 10);
if(resizeObj&&document.body&&document.body.clientWidth){
curw=parseInt(document.body.clientWidth, 10);
if(curw<minwidth){
resizeObj.style.width=minwidth+”px”;
}
else if(curw>maxwidth){
resizeObj.style.width=maxwidth+”px”;
}
if(curw<maxwidth){
if(curw>minwidth){
resizeObj.style.width=curw+”px”;
}
}
}
}
limit(‘outer’,775,999);
[/code]

In Firefox it has min-width and max-width but in IE I am using javascript and it wont work for both min and max at the same time.

Currently it can start small and go big but then it wont go small again unless the reload button is pressed and that is the problem. It has to resize both ways.

Thanks for taking a look!

Ryan

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@VladdyApr 30.2005 — much easier to use IE's CSS expression() in order to ammend its dumbness

width: expression((document.documentElement.clientWidth < 700? 700 : (document.documentElement.clientWidth > 900 ? 900 : document.documentElement.clientWidth-4)) + "px");
×

Success!

Help @rrhode spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...