1

How can I maintain the size of image as a background of droppable? I don't know the size of image so when I set the droppable background to an image it either crops to fit the designated area or multiplies to fit it? How can I make it to fit the area by streching while maintaining the aspect ratio?

Since I already define the size of droppable in my style, I don't want to change the size of my droppable to fit the image. Rather, I want the image to be loaded to be completely contained with proper aspect ratio to the droppable meaning without being cropped or multiplied. Can this be done through jquery or javascript?

Jack_of_All_Trades
  • 10,942
  • 18
  • 58
  • 88

1 Answers1

2

Two possible solutions: The first is PHP GD's imagesx() and imagesy(). That is using PHP, sure, but if you can use PHP, it can be good as then you'll perhaps learns some PHP GD too. :)

Otherwise, you could use the solution to this question.

Community
  • 1
  • 1
axiomer
  • 2,088
  • 1
  • 17
  • 26