Home Forums Weaver Xtreme Theme Javascript Function in Advanced Option > Head Section Disappears

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #17503

    I have what I thought was a simple function to swap out an image when I hover over a link. The script itself is generated by Dreamweaver. It works fine in a plain old html page. The example is here:


    When I paste the following in the Advanced Options > Head Section, the MM_findOb function is stripped out.

    <script type=”text/javascript”>

    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;

    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf(“?”))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers
      if(!x && d.getElementById) x=d.getElementById(n); return x;

    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a
    ))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

    I tried the same experiment in another WordPress website using Weaver II Pro: http://bannermountainartisans.com/test/

    The MM_findOb function is NOT stripped out and the swap works.

    Any ideas how to get around this?


    @weaver will need to have a look at that


    OK. Do you need anything else from me?


    Updated the theme this morning. It works! Thank you.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.