ericleonardo Posted September 30, 2017 Report Posted September 30, 2017 Hi! Please, what file should I edit so Revive output images (img tag) with some added class atribute by default? I need to add "img-responsive" class atribute (from bootstrap) to make my image banner responsive. Already tried javascript, but it seems can't find that img element generated by Revive. Thanks! Quote
ericleonardo Posted October 2, 2017 Author Report Posted October 2, 2017 SOLVED! Now I'm using the "Javascript Tag" Invocation Code (instead of Asynchronous Javascript Tag) serving Responsive and Centered image. Just put the invocation code inside a DIV and added a piece of code in the end only for the addClass purpose, THIS WAY: <div class="mydiv"> //INVOCATION CODE (I added "async" inside script tag hoping it to work asyncly, despit not being the Async invocation code) <!-- Revive Adserver Javascript Tag - Generated with Revive Adserver v4.1.0-rc1 --> <script async type='text/javascript'><!--//<![CDATA[ var m3_u = (location.protocol=='https:'?'https://example.com.br/adserver/www/delivery/ajs.php':'http://example.com.br/adserver/www/delivery/ajs.php'); var m3_r = Math.floor(Math.random()*99999999999); if (!document.MAX_used) document.MAX_used = ','; document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u); document.write ("?zoneid=1"); document.write ('&cb=' + m3_r); if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used); document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : '')); document.write ("&loc=" + escape(window.location)); if (document.referrer) document.write ("&referer=" + escape(document.referrer)); if (document.context) document.write ("&context=" + escape(document.context)); if (document.mmm_fo) document.write ("&mmm_fo=1"); document.write ("'><\/scr"+"ipt>"); //HERE IS THE SIMPLE CODE to add two Bootstrap classes on the image: make image Responsive and horizontally Centered. $(document).ready(function () { var img = $('.mydiv').contents().find('img').addClass('img-responsive center-block'); }); //END //]]>--></script><noscript><a href='http://example.com.br/adserver/www/delivery/ck.php?n=a1389b42&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://example.com.br/adserver/www/delivery/avw.php?zoneid=1&cb=INSERT_RANDOM_NUMBER_HERE&n=a1389b42' border='0' alt='' /></a></noscript> </div> andrewatfornax 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.