/    Sign up×
Community /Pin to ProfileBookmark

Help Me with onload

[B]I’ve got this code for resize image with my forum [ phpBB ][/B]

[CODE]#
#—–[ OPEN ]——————————————
#

News/bbcode.tpl

#
#—–[FIND]——————————————
#

<!– BEGIN img –><img src=”{URL}” border=”0″ /><!– END img –>

#
#—–[REPLACE WITH]——————————————
#

<!– BEGIN img –>
<script language=”javascript” type=”text/javascript”>
<!–
function pointercursor(){document.body.style.cursor = “move”;}
function unpointercursor(){document.body.style.cursor=””;}
//–>
</script>
<img src=”{URL}” border=”0″ onmouseout=”unpointercursor();” onmouseover=”if(this.width == 600) {pointercursor();}” onclick=”if(this.width == 600) { window.open(‘templates/News/resizefix.php?originalsize={URL}’, ‘_blank’ ,’scrollbars=1,toolbar=no,resizable=1,menubar=no,directories=no,status=yes’); return false; }” alt=”” />
<!– END img –>

#
#—–[ OPEN ]——————————————
#

News/overall_header.tpl

#
#—–[FIND]——————————————
#

<!– END switch_enable_pm_popup –>

#
#—–[ AFTER, ADD ]——————————————
#

<script language=”javascript” type=”text/javascript”>
<!–
function resize_images()
{
for (i = 0; i < document.images.length; i++)
{
while ( !document.images[i].load )
{
break;
}
if ( document.images[i].width > 600 )
{
document.images[i].width = 600;
}
}
}
//–>
</script>

#
#—–[FIND]——————————————
#

<body bgcolor=”{T_BODY_BGCOLOR}” text=”{T_BODY_TEXT}” link=”{T_BODY_LINK}” vlink=”{T_BODY_VLINK}”>

#
#—–[ IN-LINE FIND ]——————————————
#

vlink=”{T_BODY_VLINK}”

#
#—–[ IN-LINE AFTER, ADD ]——————————————
#

onload=”resize_images()”[/CODE]

[B]and this Js file[/B]

[CODE]<html>
<head>
<!–

ResizeFix 1.0.0 for phpBB
www.mikelothar.com (c) 2004

//–>

<title>Original size</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>
<style type=”text/css”>
<!–
body {
background-color: #EBEBEB;
/*
scrollbar-face-color: #E3E3E3;
scrollbar-highlight-color: #E3E3E3;
scrollbar-shadow-color: #E3E3E3;
scrollbar-3dlight-color: #E3E3E3;
scrollbar-arrow-color: #E3E3E3;
scrollbar-track-color: #EBEBEB;
scrollbar-darkshadow-color: #E3E3E3;
*/
}

table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size : 10; }
a:link,a:active,a:visited { text-decoration: none; color : #111111; }
a:hover { text-decoration: underline; color : #C51E21; }
//–>
</style>
<script language=”JavaScript”>
window.onload = maxWindow;
function maxWindow()
{
window.moveTo(0,0);
if (document.all)
{
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
{
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>

<body leftmargin=”0″ topmargin=”0″ marginwidth=”0″ marginheight=”0″>
<table width=”100%” height=”99%” border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td bordercolor=”#FFFFFF”><div align=”center”>
<table width=”50″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td align=”center”><table width=”1″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td bgcolor=”#000000″><a href=”javascript:window.close();”><img src=”<?PHP print $HTTP_GET_VARS[originalsize];?>” alt=”Close this window” border=”0″></a></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><div align=”center”><br />
<a href=”javascript:window.close();”>Close this window</a></div></td>
</tr>
</table>
</div></td>
</tr>
</table>
</body>
</html>[/CODE]

=====================

This script seem to be OK but, a problem is onload image , this script will resize image after load complete, but before loading it’s still show full size

I’m not good in JS script , Someone Please add onload option [ resize when loading image ]

[B]Thank you very much
Umpol[/B]

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@userloginApr 29.2006 — I would drop this bit of code for sure...
[CODE]function maxWindow()
{
window.moveTo(0,0);
if (document.all)
{
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
{
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
[/CODE]


Quickest way to turn your visitors away.
Copy linkTweet thisAlerts:
@umpolauthorApr 29.2006 — Thank you very much for your advice

but I very poor with Js

please tell me where to put your code in.
Copy linkTweet thisAlerts:
@userloginApr 29.2006 — I forgot to point out that people dont like having their browser windows resizes, moved or anything that will alter their viewing pleasure, what most people have is a browser set to their preferences and if you go and change it, your only annoying the visitor who is less likely to return, if your relying on returners, they will be lower compaired to if you simply leave the browser as it is.
Copy linkTweet thisAlerts:
@umpolauthorApr 29.2006 — people dont like having their browser windows resizes[/QUOTE]

Not agree with this comment

I think, people don't like too large picture because of it make webpage too large and they need to use scoll bar if they would like to read text content.

your comment is true if some forums is picture post forums, but my forums is not use for pic post.

Thank you for your comment
Copy linkTweet thisAlerts:
@userloginApr 29.2006 — the 10 commandments...

of which some recomndations are that you...

Dont allow sideways scroll

Dont change Browser position

Dont change Browser size

All you need to do is look up on your fave search engine for the 10 commandments of web building and you will see that my comment is very true and a fact.
×

Success!

Help @umpol 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 5.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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