search

Home  >  Q&A  >  body text

javascript - Use jquery to control the width of the image to enlarge it. When the width of the img is equal to the width of the outer div, the width of the img cannot be enlarged. How to break this limit?

$scope.bigimgFun = function () {

  var width =  $("#showImg").width();
  var height =  $("#showImg").height();
  console.log(width);
  console.log(height);
  $("#showImg").css({
    "width":(width+100).toString()+'px'}
    );
};
学习ing学习ing2730 days ago994

reply all(3)I'll reply

  • 習慣沉默

    習慣沉默2017-07-05 10:50:01

    It’s probably covered by the outer layer of p

    reply
    0
  • 阿神

    阿神2017-07-05 10:50:01

    Just don’t fix the size of the outer p. . Or you can use a script to modify the width and height of the outer p.

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-05 10:50:01

    The problem is that part of the content cannot be seen or the width of the content cannot be enlarged;
    The outer p does not have a given width, it depends on the content, or the img is separated from the document flow.

    reply
    0
  • Cancelreply