div和图像没有响应 [英] The div and images are not responsive

查看:79
本文介绍了div和图像没有响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

网站:showdeal.in我从snapdeal放置了一个静态横幅,但横幅用完了容器框。静态横幅是一个javascript,其中包含固定的高度和宽度。以下是代码:

Website: showdeal.in I have places a static banner from snapdeal but the banner runs out of its container box. The static banner is a javascript with fixed height and width mentioned in it. Here is the code:

<div class="col-lg-4 col-md-4">
    <div class="panel panel-primary">
        <div class="panel-heading">TITLE</div>
        <div class="panel-body">
            <div data-SDID="someidhere"  data-identifier="SnapdealAffiliateAds" data-height="auto" data-width="auto" >
            </div><script async id="snap_zxcvbnhg" src="https://affiliate-ads.snapdeal.com/affiliate/js/snapdealAffiliate.js"></script>
        </div>
    </div>
</div>



我在head部分使用了以下jquery(也在body之后尝试过)来为我从snapdeal获得的图像添加响应类:


I have used following jquery in head section (also tried it after body) to add responsive classes to the image i get from snapdeal:

<script>
    $(document).ready(function() 
    {
        $("img").addClass("img");
        $("img").addClass("img-responsive");
    });
</script>



但是,没有奇迹。请帮忙。



我尝试过:



静态宽度到图像,自动宽度和图像的自动高度以及对图像的响应。

实际上,移动设备中的视图很好,但在笔记本电脑上,瓷砖会从容器中移出。我尝试使用auto代替修复宽度,但它仍然无法正常工作,因为脚本会在运行时覆盖维度。请参阅showdeal.in的view-source以获得渲染结果。


but, no wonders. Please help.

What I have tried:

static width to image, auto width and auto height to images and responsiveness to image.
Actually, the view in mobile is fine, but on laptop, the tiles get out of the container. I tried auto in place of fix width, still it didnt work because the script overrides the dimensions at runtime. please see the view-source of showdeal.in for rendered result.

推荐答案

document )。ready ( function ()
{
(document).ready(function() {


img)。addClass( img);
("img").addClass("img");


img)。addClass( img-responsive);
});
< / script>
("img").addClass("img-responsive"); }); </script>



但是,没有奇迹。请帮忙。



我尝试过:



静态宽度到图像,自动宽度和图像的自动高度以及对图像的响应。

实际上,移动设备中的视图很好,但在笔记本电脑上,瓷砖会从容器中移出。我尝试使用auto代替修复宽度,但它仍然无法正常工作,因为脚本会在运行时覆盖维度。请参阅showdeal.in的view-source了解渲染结果。


but, no wonders. Please help.

What I have tried:

static width to image, auto width and auto height to images and responsiveness to image.
Actually, the view in mobile is fine, but on laptop, the tiles get out of the container. I tried auto in place of fix width, still it didnt work because the script overrides the dimensions at runtime. please see the view-source of showdeal.in for rendered result.


这篇关于div和图像没有响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆