[jQuery] Re: Image Resize onload - works 50% of the time : help?

2009-09-05 Thread Charlie





document.ready doesn't mean images are loaded 

you need load handlers in order to do what you want. A quick google
search found this fairly good explanation and a plugin to help

http://enhance.qd-creative.co.uk/2008/12/06/the-magic-of-onload-revealed/

Roboto wrote:

  Hey everyone,
Still new to jquery, I was just using it to resize large images to
ensure my css wouldn't break.  Sometimes it works, and sometimes it
doesn't.
By working, it's working as intended.
By not working, the images aren't showing at all (FF, IE, Saf4) -- or
safari 4.0 isn't rendering it correctly -- as in there are images
larger than the maxWidth specification.

You can observe the bug here: http://www.ready-ready.org/teams/27
If the images don't show, they will after a quick refresh.

Any help or insight would be appreciated.

My code is as follows (kinda redundant, but I'm more focused on making
it work):
$(function(){
	$(".team_bulletin_image").each(function(){
		var maxWidth = 600;
		if($(this).width()  maxWidth){
			newWidth = maxWidth;
			newHeight = $(this).height() * (maxWidth / $(this).width());
			$(this).height(newHeight).width(newWidth);
		}
	});

	$("#team_logo").each(function(){
		var maxWidth = 254;
		if($(this).width()  maxWidth){
			newWidth = maxWidth;
			newHeight = $(this).height() * (maxWidth / $(this).width());
			$(this).height(newHeight).width(newWidth);
		}
	});

	$("#nav_tools").each(function(){
		var maxHeight = 134;
		var logoHeight = $("#team_logo").height()
		if(logoHeight  maxHeight){
			$(this).css("margin-top", (logoHeight - maxHeight) + "px");
		}
	});
});

  






[jQuery] Re: Image resize

2009-06-19 Thread mojoeJohn

resize it in what way? on a hover or an image replacement or what?

On Jun 18, 11:25 pm, bharani kumar bharanikumariyer...@gmail.com
wrote:
 Hello Friends ,

 How to resize the image using jquery ,

 Thanks

 B.S..Bharanikumar


[jQuery] Re: Image resize

2009-06-19 Thread bharani kumar
when upload ,

On Fri, Jun 19, 2009 at 7:33 PM, mojoeJohn mojoej...@gmail.com wrote:


 resize it in what way? on a hover or an image replacement or what?

 On Jun 18, 11:25 pm, bharani kumar bharanikumariyer...@gmail.com
 wrote:
  Hello Friends ,
 
  How to resize the image using jquery ,
 
  Thanks
 
  B.S..Bharanikumar




-- 
Regards
B.S.Bharanikumar
http://php-mysql-jquery.blogspot.com/


[jQuery] Re: Image resize

2009-06-19 Thread Charlie





that's a server side issue, not client side

bharani kumar wrote:
when upload ,
  
  On Fri, Jun 19, 2009 at 7:33 PM, mojoeJohn mojoej...@gmail.com
wrote:
  
resize it in what way? on a hover or an image replacement or what?

On Jun 18, 11:25pm, bharani kumar bharanikumariyer...@gmail.com
wrote:

 Hello Friends ,

 How to resize the image using jquery ,

 Thanks

 B.S..Bharanikumar

  
  
  
  
  
-- 
Regards
B.S.Bharanikumar
  http://php-mysql-jquery.blogspot.com/






[jQuery] Re: Image resize

2009-06-19 Thread bharani kumar
ok

On Fri, Jun 19, 2009 at 8:59 PM, Charlie charlie...@gmail.com wrote:

  that's a server side issue, not client side


 bharani kumar wrote:

 when upload ,

 On Fri, Jun 19, 2009 at 7:33 PM, mojoeJohn mojoej...@gmail.com wrote:


 resize it in what way? on a hover or an image replacement or what?

 On Jun 18, 11:25 pm, bharani kumar bharanikumariyer...@gmail.com
 wrote:
   Hello Friends ,
 
  How to resize the image using jquery ,
 
  Thanks
 
  B.S..Bharanikumar




 --
 Regards
 B.S.Bharanikumar
 http://php-mysql-jquery.blogspot.com/





-- 
Regards
B.S.Bharanikumar
http://php-mysql-jquery.blogspot.com/


[jQuery] Re: Image resize

2009-06-19 Thread kalyan

Use jqeary plugin Jcrop. It will resize your imaze before upload.

Here is the link to download : http://deepliquid.com/content/Jcrop.html

On Jun 19, 7:41 pm, bharani kumar bharanikumariyer...@gmail.com
wrote:
 when upload ,

 On Fri, Jun 19, 2009 at 7:33 PM, mojoeJohn mojoej...@gmail.com wrote:

  resize it in what way? on a hover or an image replacement or what?

  On Jun 18, 11:25 pm, bharani kumar bharanikumariyer...@gmail.com
  wrote:
   Hello Friends ,

   How to resize the image using jquery ,

   Thanks

   B.S..Bharanikumar

 --
 Regards
 B.S.Bharanikumarhttp://php-mysql-jquery.blogspot.com/


[jQuery] Re: Image resize

2009-06-19 Thread brian

On Fri, Jun 19, 2009 at 10:57 AM, kalyankalyan11021...@gmail.com wrote:

 Use jqeary plugin Jcrop. It will resize your imaze before upload.

 Here is the link to download : http://deepliquid.com/content/Jcrop.html

It does no such thing. That plugin still requires something on the
server to do the resizing. What jCrop does is to pass image
coordinates and sizes to a server-side script. That's an important
difference because too many people seem utterly confused about
client-side vs. server-side implementations.

It *is* a very cool tool, though.


[jQuery] Re: Image resize

2009-06-19 Thread kalyan

Then use imagemagic to create image resizing if you are using PHP.

On Jun 19, 9:43 pm, brian bally.z...@gmail.com wrote:
 On Fri, Jun 19, 2009 at 10:57 AM, kalyankalyan11021...@gmail.com wrote:

  Use jqeary plugin Jcrop. It will resize your imaze before upload.

  Here is the link to download :http://deepliquid.com/content/Jcrop.html

 It does no such thing. That plugin still requires something on the
 server to do the resizing. What jCrop does is to pass image
 coordinates and sizes to a server-side script. That's an important
 difference because too many people seem utterly confused about
 client-side vs. server-side implementations.

 It *is* a very cool tool, though.