Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 auto-resizing images within messages
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

work mule
Senior Member

USA
1358 Posts

Posted - 14 June 2003 :  13:16:37  Show Profile
I read this post and decided to offer up a solution I added recently to one of our sites. It's really simple to implement. No, it may not work perfectly for all browsers, but looking at the majority of browsers being used by visitors to our site, it suits our needs.

Download code w/instructions:
http://www.snitzbitz.com/mods/details.asp?Version=All&mid=137

Demo:
http://www.finescale.com/fsm/community/forum/topic.asp?TOPIC_ID=3996

Discussion on the site about this feature:
http://www.finescale.com/fsm/community/forum/topic.asp?TOPIC_ID=3759

BTW, it's far from being a perfect solution, but it's better than nothing.

Edited by - work mule on 14 June 2003 13:26:46

Ez4arab
Junior Member

479 Posts

Posted - 14 June 2003 :  15:32:22  Show Profile  Visit Ez4arab's Homepage
I have installed this mod, but I have bug on it when I make refresh the pic retune to its original dimension

e.g. orginal size 600X800 convert to new 350X350 size after make refresh it return to 600X800 i am using IE6.0.28

Ez4arab web site Ez4arab |
Go to Top of Page

Dave.
Senior Member

USA
1037 Posts

Posted - 14 June 2003 :  19:05:37  Show Profile
Is it possible for the window to come up with your mouse in the center when the image is clicked?
Go to Top of Page

bjornsgaard
Starting Member

Italy
2 Posts

Posted - 14 June 2003 :  19:14:39  Show Profile  Visit bjornsgaard's Homepage
Pls can tell me how to install exactly this MOD?
I don't know JavaScript/CSS :(
Thanx!

BJ

>O< BJLamps! >O<
Go to Top of Page

kornkob
Starting Member

1 Posts

Posted - 17 June 2003 :  13:16:26  Show Profile
Can I simply replace the 'width' in the java portion with height and thereby restrict the height of an image instead? That what is causing problems for our forums--- people putting in really tall images that have to be scrolled past to get to the next post.
Go to Top of Page

StreetPony
Starting Member

USA
23 Posts

Posted - 19 June 2003 :  01:28:43  Show Profile  Visit StreetPony's Homepage
hi work mule,
WOW.....your MOD does exactly what i want it to do. sadly, i cannot seem to make it work for me. im sure the problem is on my end, and im not reading/entering something correct. i wonder, since i dont have any other MODS on my board, do you have pages with your MOD built in that could just upload to my server over-writing the existing pages?
thanks!

Nathan W. Collier

Go to Top of Page

skellyx
Starting Member

24 Posts

Posted - 20 July 2003 :  05:26:46  Show Profile
I have installed this mod, but I have bug on it when I make refresh the pic retune to its original dimension.
Help Me
Hi
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 20 July 2003 :  10:38:01  Show Profile
quote:
Originally posted by skellyx
I have installed this mod, but I have bug on it when I make refresh the pic retune to its original dimension.



Honestly, I'm not sure why that happens. Usually that happens to me if I've specifically viewed the image at full size. Then it appears full size, regardless of the script. I'm wondering if maybe it's something between a cached image and when/if the onLoad() function executes? I really don't know (yet).
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 20 July 2003 :  10:40:50  Show Profile
quote:
Originally posted by kornkob
Can I simply replace the 'width' in the java portion with height and thereby restrict the height of an image instead? That what is causing problems for our forums--- people putting in really tall images that have to be scrolled past to get to the next post.



I know I answered this when the question was posted on the www.finescale.com site, but I'll post the answer here in case anyone else was waiting for the answer.

- - - - - - - - - - - - - - - - - - - - - - -

quote:
Originally posted by Kornkob
Woudl it be practical for me to duplicate the width requirement lines of code with height requirement so that both dimensions are size restricted?


I wouldn't set both at the same time. Your image will become distorted. Either set the width or the height and let the browser adjust the other proportionately. To do this, you would want to check which one is the larger of the two -- the width or the height. Then adjust accordingly.

The following code should do that. You'll need to change the variables to the max width and max height you want to allow for the site.

Hope that helps!


<SCRIPT LANGUAGE="JavaScript">
<!--

// Set the Maximum Width and Height
var maxImageWidth = 350;
var maxImageHeight = 350;

function resizeImage(thisimage) {
   if (thisimage.height > thisimage.width) {
      // check and modify height if needed
      if (thisimage.height > maxImageHeight) {
         thisimage.height = maxImageHeight;
         thisimage.style.cursor='hand';
      }
   } else {
      // check and modify width if needed
      if (thisimage.width > maxImageWidth) {
         thisimage.width = maxImageWidth;
         thisimage.style.cursor='hand';
      }
   }
}
 
//  End -->
</script> 


Oh, if you have a lot of scripts on your site, you might want to move the var statements inside the function itself to avoid any conflicts between variables (variable scope).
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 20 July 2003 :  19:07:57  Show Profile  Visit dayve's Homepage
just installed it and it appears to work like a champ... only time will tell though.

FYI, I did test it in IE6, OP7 and NS7 and they all worked for resizing the images, but Netscape did not work for previewing the image at its normal size, but that is no big deal to me, in fact I think I am going to disable the preview option all together.

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 20 July 2003 :  19:13:36  Show Profile  Visit dayve's Homepage
A suggestion. When using the ONCLICK to preview the image at its normal size, the CLOSE option goes off screen, I recommend changing this line:

crossobj.innerHTML='<div class=tvhead align=right id=drag><span class=tvclose onClick=closepreview()>Click to Close</span> <span class=tvclosex onClick=closepreview()> X </span></div><img src="'+which.src+'">'

to this

crossobj.innerHTML='<div class=tvhead align=left id=drag><span class=tvclose onClick=closepreview()>Click to Close</span> <span class=tvclosex onClick=closepreview()> X </span></div><img src="'+which.src+'">'

Here is another link to a DEMO:

http://www.burningsoulsforum.com/topic.asp?TOPIC_ID=6862


Edited by - dayve on 20 July 2003 19:33:09
Go to Top of Page

skellyx
Starting Member

24 Posts

Posted - 22 July 2003 :  13:57:37  Show Profile
thanks Work Mule
Dayve in the demo if refresh the pic retune to its original dimension
as it happens to me, cache? mah
excused ugly English
Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 September 2003 :  13:38:47  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
This mod looks like exactly what I need but I am having some troubles installing it. Where do I place the code for steps 4 and 3. The first step in in inc_functions_common, the it is inc_footer, I am unclear as to where the rest goes though. Thanks for any help any of you can offer.




Erick
Snowmobile Fanatics

Go to Top of Page

weeweeslap
Senior Member

USA
1077 Posts

Posted - 09 September 2003 :  18:52:18  Show Profile  Visit weeweeslap's Homepage  Send weeweeslap an AOL message  Send weeweeslap a Yahoo! Message
3 and 4 go to the inc_header.asp file I believe as that is where the css is declared and the jscript as well goes there.

coaster crazy
Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 September 2003 :  19:28:19  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
Hmm, Ok...still a little confused but I will try it out.




Erick
Snowmobile Fanatics


Edited by - sr_erick on 09 September 2003 19:36:23
Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 September 2003 :  20:00:07  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
Ok, figured it out. I am however having the little refresh thing that others are having. It doesn't do it on dayves demo though.




Erick
Snowmobile Fanatics

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07