Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Scale Posted Pictures
Acidphantom



Joined: 01 Apr 2008
Posts: 783
Location: Germany

Posted: 05/11/12 09:30 
Hello to all,

how I can make scale on max wide in this code the pictures also if they smaller then the max size?



Code
<script>
window.onload = resizeimg;
function resizeimg()
{
   if (document.getElementsByTagName)
   {
      for (i=0; i<document.getElementsByTagName('img').length; i++)
      {
         im = document.getElementsByTagName('img')[i];
         if (im.width > 600)
         {
            im.style.width = '600px';
            eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
            eval("im.onclick = pop" + String(i) + ";");
            if (document.all) im.style.cursor = 'hand';
            if (!document.all) im.style.cursor = 'pointer';
            im.title = 'Click Here To See Image Full Size ';
         }
      }
   }
}

</script>



Best regards,
Acidphantom

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 05/11/12 11:27 
Which images are you wanting to resize?

Can you not use Jamroom image.php script?

http://www.jamroom.net/Jamroom4_Image_Script

Hope this helps,
Douglas


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Acidphantom



Joined: 01 Apr 2008
Posts: 783
Location: Germany

Posted: 05/11/12 14:41 
it is a phpbb mod.... Just wanted to know if I can make a scaled option in it.

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 05/11/12 19:50 

Code

         if (im.width > 600)
         {
           //do all that scaling stuff
         }


This line of code reads "If the image width is greater than 600, then go into this block of code and do what it says."

But its not really resizing the image in the same way the jamroom script does. this piece of code is only setting a width="600" on the image html, so making smaller pics get big might not look so nice.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Acidphantom



Joined: 01 Apr 2008
Posts: 783
Location: Germany

Posted: 05/12/12 03:24 
Ok then its ok like it is now Wink thanks for the replys...

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.