Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends,

I am uploading a image and showing it to a fixed size(width='728' height='286')image box but images are not showing correctly as the actual image , even the large images seen faded or distort ,
is there any function or any property or something like this by which i can show a proper image in the image box.

If yes then pls share any link or your suggestion to do this,
This the code what i am using

PHP
<div class="profile-page-fimlay-banner"><?php echo "<a class='fancybox' href='pic/".$family_photo."' data-fancybox-group='gallery'>";?> <?php echo "<img src='pic/".$family_photo."' width='728' height='286' border='0' />" ."</a>";?>
</div>


thanks
Posted
Updated 11-Oct-12 0:02am
v2
Comments
enhzflep 11-Oct-12 5:37am    
Rather than setting both dimensions, just set one of them. This way your images will stay the same shape and won't exhibit aspect-ratio distortions.

I generally fix the height, since it's less disruptive to the page layout to have images of varying widths than it is to have different heights, but as always, your mileage may vary.
[no name] 11-Oct-12 6:03am    
Thanks
But if the width will more it will out of box (div).
And if less then the remaining side will be shown blank.
enhzflep 11-Oct-12 7:19am    
No worries. In that case, you'll get a better answer if you show a small, but complete and functioning example of your code.

You could edit your question to include it, or better yet - use JsFiddle

Here's an example of using jsFiddle: JsFiddle sample

1 solution

Try given below plug in

http://www.garralab.com/nailthumb.php[^]


On your web page use like code given below:
C#
jQuery('.ImageClass').imgpreload({
            each: function () {
                $(this).nailthumb({
                    height: 115,
                    width: 115,
                    preload: false,
                    method: 'resize',
                    fitDirection: 'left',
                    replaceAnimation: 'no animate',
                    maxEnlargement: 1
                });
            },
            all: function () {
            }
        });



Here 'ImageClass' is the class applied on . Just also add 'display:none' as style for the same .
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900