Please upgrade here. These earlier versions are no longer being updated and have security issues.

Set Maximum Image Size

RonRon New
edited July 2010 in Vanilla 2.0 - 2.8
How do I set the maximum image size in a new discussion? I am using jQuery WYSIWYG as my editor. I don't want large images to break my theme. Can images be set automatically re size.

Comments

  • not so great, but a solution:

    http://pastebin.com/2GhWATSq

    add this to the js/global.js, before the });
  • that works but when I goto the page the image is regular size. then I need to refresh the page to have it shrink. thanks for your help though
  • well, here is the updated version, it works without refresh.

    http://pastebin.com/aGwHUUc0
  • hmm odd. it's doing the same thing. when i go directory to the post the image is full size and breaks the theme. when i refresh it shrinks it.
  • Its work for me.
    What browser did you use?
    Maybe you can share a link?
  • I use FireFox. The link may be too sensitive for this forum.
  • I check in Firefox too, and its working for me:(
  • Can you show me exactly what it looks like in your global js?
  • passatgtpassatgt New
    edited July 2010
    function imageResize() { $('img').load(function() { $('.Message p img').each(function() { var width = $(this).width(); var url = $(this).attr('src'); if (width >655) { $(this).attr('width','655'); $(this).after('<br/><a href="'+url+'" target="_blank">Teljes méret</b>'); } }); }); } imageResize(); //When you make a comment, the page not going to refresh, only the message list, so you need to run the function again. $('ul.MessageList').ajaxComplete(function() { imageResize(); });
  • Yea same as me. I am using jQuery WYSIWYG what's the chances of this conflicting with it?
  • well, try it out:)
  • Disabled all plugins and still had same issue. Oh well, I'll look elsewhere. Thank you.
Sign In or Register to comment.