Welcome Guest ( Log In | Register )




                Web Hosting Guide

3 Pages V  < 1 2 3 >  
Reply to this topicNew Topic
Enlarge Image Script
Quatrux
post Dec 6 2007, 08:01 AM
Post #11


the Q
Group Icon

Group: [HOSTED]
Posts: 1,355
Joined: 13-July 05
From: Lithuania, Vilnius
Member No.: 7,059
myCENTs:82.09


QUOTE(FeedBacker @ Oct 31 2007, 05:52 AM) [snapback]113782[/snapback]
But there's one question that I have been wondering about. How do you keep the image looking good even after it is being enlarged? What I have seen so far is that only dimensions of the original image size will look good.
-Domoto Rima


Well, there can be some ways to do it, the enlargement can really be done with Opera for example by pressing + key, it will zoom and if you only want to zoom the image and not the content, just use Open image and then use the zoom key biggrin.gif

Also, you can do it with javascript by having two pictures, a thumbnail and a normal picture, but here you can zoom one picture, I mean by using this script, if you want the enlargement to be better quality, you just need the image dimensions to be the same as the enlarged image and then the image is small, it is scaled by the browser to a small size biggrin.gif The bad thing is that if there are a lot of images, they will take more to load, due to big image filesize, so it is a waste of bandwidth if nobody will enlarge them.. and also I never liked how browsers scale images to smaller dimensions..

I always prefer to use two images, a thumbnail and a normal image for this kind of things, even though it can be done with imagemagick or gd library every time, but why waste the resources of a server? it will need to scale it every time, unless it will do some checking, will save the thumbnails and if they exist, it won't scale, but show it, this wouldn't be the most logic decision. smile.gif
Go to the top of the page
 
+Quote Post
TavoxPeru
post Dec 7 2007, 01:40 AM
Post #12


Super Member
Group Icon

Group: [HOSTED]
Posts: 876
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:13.21


QUOTE(Quatrux @ Dec 6 2007, 03:01 AM) [snapback]114860[/snapback]
Well, there can be some ways to do it, the enlargement can really be done with Opera for example by pressing + key, it will zoom and if you only want to zoom the image and not the content, just use Open image and then use the zoom key biggrin.gif

Also, you can do it with javascript by having two pictures, a thumbnail and a normal picture, but here you can zoom one picture, I mean by using this script, if you want the enlargement to be better quality, you just need the image dimensions to be the same as the enlarged image and then the image is small, it is scaled by the browser to a small size biggrin.gif The bad thing is that if there are a lot of images, they will take more to load, due to big image filesize, so it is a waste of bandwidth if nobody will enlarge them.. and also I never liked how browsers scale images to smaller dimensions..

I always prefer to use two images, a thumbnail and a normal image for this kind of things, even though it can be done with imagemagick or gd library every time, but why waste the resources of a server? it will need to scale it every time, unless it will do some checking, will save the thumbnails and if they exist, it won't scale, but show it, this wouldn't be the most logic decision. smile.gif

As you, i don't like that the browser scales automatically bigger images, of course there are sometimes that it is useful but not every time. This script is useful only when you have few images on your page, when we talk about lots of them i do exactly the same thing, use two images, a thumbnail and the original.

Best regards,
Go to the top of the page
 
+Quote Post
polarysekt
post Dec 7 2007, 11:41 PM
Post #13


Advanced Member
Group Icon

Group: Members
Posts: 128
Joined: 12-February 05
From: St. Louis, MO
Member No.: 2,612


QUOTE
How do you make it go back to normal, like onhoveroff?



I would use... OnMouseOver and OnMouseExit if you're looking for a hover-only effect...


funny thing is i think i came across the stretching feature on accident one of the first few times I used an IDE... They love to stick the dimensions of the images in there for you (as it somewhat preallocates the space, especially on slow connections)... and i think i plugged in a different image manually... like with notepad or kate... and it stretched....

lots of things just come out of nowhere...
Go to the top of the page
 
+Quote Post
jlhaslip
post Dec 8 2007, 04:25 AM
Post #14


Advanced Member
Group Icon

Group: Members
Posts: 197
Joined: 15-November 05
From: Inland from the Left Coast of Canada
Member No.: 9,627
myCENTs:44.50


Google hoverbox to find a CSS method to increase the size of a picture on-hover. No javascript required.
Go to the top of the page
 
+Quote Post
Quatrux
post Dec 8 2007, 07:49 AM
Post #15


the Q
Group Icon

Group: [HOSTED]
Posts: 1,355
Joined: 13-July 05
From: Lithuania, Vilnius
Member No.: 7,059
myCENTs:82.09


Yeah, it can be done with CSS, even though the technique is a bit different then in the first post, take this example:

http://www.yo.com.mx/rollover/roll.html - it is css only as I understand.

if you just change the width and height, you'll get a bigger picture or a smaller, depends on the dimensions you chosen ;]
Go to the top of the page
 
+Quote Post
TavoxPeru
post Dec 8 2007, 10:07 AM
Post #16


Super Member
Group Icon

Group: [HOSTED]
Posts: 876
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:13.21


QUOTE(Quatrux @ Dec 8 2007, 02:49 AM) [snapback]114902[/snapback]
Yeah, it can be done with CSS, even though the technique is a bit different then in the first post, take this example:

http://www.yo.com.mx/rollover/roll.html - it is css only as I understand.

if you just change the width and height, you'll get a bigger picture or a smaller, depends on the dimensions you chosen ;]

Yes, this technique is different than the first post i made, but it is interesting also, i just test it and works fine with Internet Explorer 6 and Firefox 2.

One thing i like of that this technique is that it is very small comparing with the Hoverbox technique posted before.

Best regards,
Go to the top of the page
 
+Quote Post
iGuest
post Jan 8 2008, 04:51 PM
Post #17


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869


Enlarge Image Script
Enlarge Image Script

Hi,
I have been implementing the same type of code to enlarge a picture.
My problem is that the second action is not taken onto account, only the first. In your example, the onclick will work and the ondblclick will not...

Do you have any idea why is that?

Many thanks
A

-Alex
Go to the top of the page
 
+Quote Post
iGuest
post Jan 8 2008, 04:55 PM
Post #18


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869


Enlarge Image Script
Enlarge Image Script

Hi,

I found why your code is not working, you miss a ' on the second src

<img src="yourimage.Jpg" width="150" height="200" onclick="this.Src='yourimage.Jpg';this.Height=400;this.Width=300" ondblclick="this.Src=yourimage.Jpg';this.Height=200;this.Width=150">

Many thanks

A

-Alex
Go to the top of the page
 
+Quote Post
TavoxPeru
post Jan 17 2008, 12:03 AM
Post #19


Super Member
Group Icon

Group: [HOSTED]
Posts: 876
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:13.21


QUOTE(FeedBacker @ Jan 8 2008, 11:55 AM) [snapback]116498[/snapback]
Enlarge Image Script

Enlarge Image Script
Hi,

I found why your code is not working, you miss a ' on the second src

<img src="yourimage.Jpg" width="150" height="200" onclick="this.Src='yourimage.Jpg';this.Height=400;this.Width=300" ondblclick="this.Src=yourimage.Jpg';this.Height=200;this.Width=150">

Many thanks

A

-Alex

Oopps, thanks a lot, i gonna edit the code right now.

Best regards,
Go to the top of the page
 
+Quote Post
iGuest
post Jan 21 2008, 12:17 PM
Post #20


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869


Enlarge Image script
Enlarge Image Script

Replying to Feedbacker

Another useful tip is you can do incremental zooming by altering the code slightly ...

<img src="yourimage.Jpg" width="150" height="200" onclick="this.Src='yourimage.Jpg';this.Height=this.Height+100;this.Width=this.Width+100" ondblclick="this.Src=yourimage.Jpg';this.Height=200;this.Width=150">


-Bruv
Go to the top of the page
 
+Quote Post

3 Pages V  < 1 2 3 >
Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts  
4 PHP
8 bluefish 3,126 16th March 2010 - 02:01 PM
Last post by: iG-op
No New Posts 7 Niru 4,450 20th February 2010 - 07:04 AM
Last post by: iG-suresh
No New Posts   10 mastercomputers 360 19th February 2010 - 07:42 AM
Last post by: Quatrux
No new   19 Feelay 9,175 18th February 2010 - 08:47 AM
Last post by: iG-Tsholofelo
No New Posts   7 Eggie 157 15th February 2010 - 10:34 PM
Last post by: Nelson Blogs
No New Posts   10 Eggie 8,413 10th February 2010 - 06:47 AM
Last post by: iG-
No New Posts   6 Skepticus 187 7th February 2010 - 02:16 AM
Last post by: 8ennett
No New Posts   0 8ennett 70 30th January 2010 - 11:10 PM
Last post by: 8ennett
No new   25 JohnNitro 15,369 26th January 2010 - 11:30 AM
Last post by: iG-mdshare
No New Posts   6 shiv 4,392 14th January 2010 - 02:47 PM
Last post by: iG-Johnathan
No New Posts   15 sendto 15,293 26th December 2009 - 07:16 AM
Last post by: iG-
No New Posts   3 wutske 1,199 18th December 2009 - 07:36 AM
Last post by: iG-anil kumar
No new   31 rmdort 14,295 9th December 2009 - 05:51 AM
Last post by: iG-ash
No New Posts   10 yordan 2,538 27th October 2009 - 11:31 PM
Last post by: HannahI
No New Posts   12 avalon 4,853 23rd October 2009 - 10:15 AM
Last post by: iG-kkk


Web Hosting Powered by ComputingHost.com.
HONESTY ROCKS! truth rules.
Creative Commons License