Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • nelson 6 posts 26 karma points
    Jul 10, 2012 @ 15:27
    nelson
    0

    Problem with javascript code

    Hi,

    i have this code that doesn't work in umbraco:

    <script language="javascript" type="text/javascript">  
    $(window).load(function changeSize() {
            var cond = '../umbraco/images/';
            var iMg = document.getElementsByTagName('img');

            for (var i = 0; i < iMg.length; ++i) {
                if (iMg[i].src.match(cond)) {
                    iMg[i].style.width = '252px'; iMg[i].style.height = '147px';
                }
            }
        });

    </script


    why not work?

    Thanks for the answer.

     

  • Nigel Wilson 945 posts 2077 karma points
    Jul 10, 2012 @ 21:46
    Nigel Wilson
    1

    Hi Nelson

    Technically your query is not related to Umbraco, it is a JavaScript / jQuery problem.

    However what would be useful is it you could post a excerpt of your resulting html output to see what you are trying to "match" against.

    Cheers, Nigel

Please Sign in or register to post replies

Write your reply to:

Draft