Welcome Guest, Not a member yet? Register   Sign In
Image size settings inpendently from browser
#1

[eluser]GabrieleMartino[/eluser]
Hello,

I don't know for sure if this the exact place where to post this question, anyway I'm still trying to understand how develop and don't know the exact bound beetween codeigniter and the html side programming, in the sense of assignament.

I would like to have an image visualizzation that is a percentual (%) on the size of an <div>.

I cosrtuct my function this way

Code:
$data ['image_properties'] = array('src' => $path,
                        'alt' => 'Image Max resolution 1024 x 768. 5 Mb. jpeg,.gif,.jpg,.png',
                        'class' => 'post_images',
                        'width' => '98%',
                        'height' => '80%',
                        'title' => '1024 x 768. 4,5 Mb. jpeg, gif, png ,jpg',
                        'rel' => 'lightbox',
                        'align' => 'center',
                        );

in the controller

and

Code:
&lt;?php echo img($image_properties);?&gt;

in the view.

The visualization is fine online on a computer but do not goes well in mobile.

How can I improve the code to have a good resolution on mobile (it is too big now) ? It is possible?

Thanks
#2

[eluser]CroNiX[/eluser]
You have the width of the img set to 98%, which is fine, but what is the width of the parent container? If THAT is wider than the mobile screen (like it's a set px instead of %) then the image will fill 98% of that container - which would be too wide. I would suggest looking into a mobile CSS framework (jQuery Mobile, Twitter Bootstrap, etc), which does this stuff for you and reformats things to the current screen size.
#3

[eluser]GabrieleMartino[/eluser]
I had a look to Jquery, it seems what I was looking for. No way with normal html. Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB