• Is there a way to re-size the image in posts with mouse over? Inserting scrip in the post does not have the desired results:

    <script>
    function bigImg(x)
    {
    x.style.height="600px";
    x.style.width="300px";
    }
    
    function smallImg(x)
    {
    x.style.height="200px";
    x.style.width="100px";
    }
    </script>

    The function called within the post:
    <img onmouseover="bigImg(this)" onmouseout="smallImg(this)" border="0" src="https://dnsname.of.domain.com/wp-content/uploads/year/month/imagename.jpg" alt="" title="image name" width="100" height="200" />
    The image is shown in the post at the size defined in the above code, but no mouse over action. Removing the image size results in the posting results in displaying the original size of the image.

    Inserting mouse over effect CSS code in to the posting pretty much results in the same; the image shows up in the post, but the image does not change.

    It seems that my code above isn’t correct, or the HTML editing of the post has limitation. In which case, is there a way to resize the image in the post with mouse over action?
    TIA…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Cr00zng

    (@cr00zng)

    Adding the CCS code to the style.css file in 2012 child theme didn’t work either.
    Would adding the CSS code to the editor-style.css in the root of 2012 theme folder make a difference?
    TIA…

    Put the javascript in your <head> tag.

    I just tested the following script on a blank page:

    <script>
    function makeimagebigger(x)
    {
    x.style.height = ‘400px’;
    }
    </script>

    <img src=”whatever” id=”whatever” onmouseover=”makeimagebigger(this)” />

    Thread Starter Cr00zng

    (@cr00zng)

    Thanks Andrew for your suggestion…

    I’ve tried your script, but it wouldn’t work. Adding the CSS code to the style.css file in the 2012 child theme folder on the other hand did.

    I guess I’ve grossly overestimated the HTML based post edit’s capabilities. It seemed that one could enter HTML code and while it is true, the capabilities are very limited.

    Oh well, live and learn…

    Thanks guys for your help…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mouse over image resize in post…’ is closed to new replies.