![]() |
Auto Resize large images in an IMG tag
First, sorry about my bad english :rolleyes:
With this small hack, all large images in an IMG Tag will be resized after the site has loaded. With a click on the resized imge, it will open in an new window with the original size. Works in Firefox, Opera, IE and i think in all other browser. Here is a Demo: Link Work with vB 3.6.0 - 3.6.4 INSTALLATION: -------------------------------- - Copy the file resizevbimg.js in the dir clientscript. -------------------------------- Open the file includes/class_bbcode.php Search the line(~line 1887 ): Code:
return '<img src="' . $link . '" border="0" alt="" />'; Code:
return '<img src="' . $link . '" border="0" alt="" id="vBCodeIMG" />'; -------------------------------- Styles & Templates > Search the SHOWTHREAD Template Seach: Code:
<body onload="$onload"> Code:
<body onload="$onload;vbImageResize()"> -------------------------------- Styles & Templates > Search the NEWREPLY Template Search: Code:
<body$onload> Code:
<body onload="$onload;vbImageResize()"> -------------------------------- - Styles & Templates > Style Manager > Common Templates > headinclude Search: Code:
<!-- / CSS Stylesheet --> Code:
<script type="text/javascript" src="clientscript/resizevbimg.js"></script> -------------------------------- Styles & Templates > Style Manager > Main CSS > Additional CSS Definitions After, add: Code:
.vbimgcodelimit { -------------------------------- Done :) |
wow good hack :) installed ;)
|
Nice job. I've seen this done before, but never on [IMG] tags. Fantastic work.
|
I just installed this hack, but...how does it work? I tried to upload a new pic, but it doens't resize it..
Marco |
that is one of the best mini hacks released for ages, many many thanks dude.
works in ie/firefox |
I just came here to look for something like this after a member posted gigantic pictures! Thanks. :)
|
Quote:
|
Great work!
|
Thanks for man
|
Quote:
edit: looks like it loads the full image then resizes it on the fly GREAT HACK! THANKS update: installed and works perfectly! |
Quote:
https://vborg.vbsupport.ru/showthread.php?t=118048 |
Mine is not resizing either... This should work for all usergroups, right?
It may be my work lapptop as I have to use an older Java because of some specific apps I need... I'll see later if it works on other machines? |
great u sexy piece of ass.
|
What happens with
[ url=blar ][ img ][ /img ][ /url ] constructs? Which link will not work? // Edit - hmhm url tags are converted within code boxes?! |
Do you have some kind of a screenshot or something?
|
First time i replay to someone.
Grate hack! Grate idea! Thanks. |
Well, I just double checked my install and tested on Win XP SP1, Win XP SP and Windows 2000 and she don't work on my site... I am going to take it back off and try the other one :surprised:
Thanks for sharing as I need this bad but it doesn't like my setup I guess... |
What kind of effect does this have on server load?
|
Fantastic job on this -
We run an image heavy site with predefined dimensions and this method solves a huge layout problem for us. R+ |
Works like a charm on new posts with images, what about the old posts? do I have to reuild the threads cache?
Update: no need to do any thing as its based on JavaScript and will work automaticly, for the past posts it will show the orginal size then resize when the page done loading. |
very nice, thanks
|
great hack, thanks
|
hi, sorry for mine english.
but this hack don't work on my forum 3.6.0 can you say me, where the problem is? thank you, mfg Settler |
Quote:
|
Can this be used in Journal Pages to do the same ?
|
Quote:
|
thank u for this hack
|
mr.gamesbay,
you've made a terrific job. I am importing a large forum from smf to VB and I got tons of extremely large files that ruin my fluid xhtml page. Your hack saves me :) There's just one thing that I think should be changed. It is illegal to declare more than one object with the same id on the same page. I think you should've used class for declaration: 1. for includes/class_bbcode.php: Code:
return '<img src="' . $link . '" border="0" alt="" class="vBCodeIMG" />'; Code:
if (docImg[i].width > vbimgcodeWidthMax && docImg[i].className == 'vBCodeIMG') { |
Works with vBadvanced too:
mod the adv_portal template find Code:
<body> Code:
<body onload="$onload;vbImageResize()"> |
if only this was a plugin :(
|
Lol, didnt worked for me bro, but nice effort.
|
INSTALLED. Works perfect.
|
yup, nice mods !! juz installed
|
working great, thx a lot
|
works great, thanks!
|
will this work with 3.6.1
|
Quote:
|
hi..
it is resizing the image (decrease size) , not adding scroll bar ?? |
great great great , installed and work perfect thanks man
|
Installed, all i can say is wow
|
All times are GMT. The time now is 05:21 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|