Closed Thread
Results 1 to 5 of 5




  

Thread: what is this script?

      
  1. #1
    Nips Spam in the Bud EmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to behold EmmaB's Avatar
    Join Date
    February 15, 2008
    Location
    Ontario, Canada
    Posts
    779
    Rep Power
    6
    Feedback Score
    0

    Default what is this script?

    I got a template today and within it was this code
    Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    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[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      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[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    What does this do? I took it out of the html page to see what would happen and nothing happened. Im curious though, anyone know?

  2. #2
    Stumped dino is a jewel in the roughdino is a jewel in the roughdino is a jewel in the roughdino is a jewel in the roughdino is a jewel in the roughdino is a jewel in the rough dino's Avatar
    Join Date
    March 29, 2008
    Posts
    335
    Rep Power
    5
    Feedback Score
    0

    Default Re: what is this script?

    Looks like some kind of mouse-over javascript, usually related to your navigation menu.

  3. #3
    Jedi Master Mark will become famous soon enoughMark will become famous soon enough
    Join Date
    August 9, 2007
    Location
    UK
    Posts
    59
    Rep Power
    5
    Feedback Score
    0

    Default Re: what is this script?

    felit0 is right. It looks like the standard code created by Adobe/Macromedia products to create a rollover effect for images. You may find that without that javascript, you will lose some graphical interactivity. If everything remained the same when you removed the code, feel free to leave it out since you obviously do not need it.

  4. #4
    Nips Spam in the Bud EmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to beholdEmmaB is a splendid one to behold EmmaB's Avatar
    Join Date
    February 15, 2008
    Location
    Ontario, Canada
    Posts
    779
    Rep Power
    6
    Feedback Score
    0

    Default Re: what is this script?

    i found out what it was. Its a script that preloads the images/loads them fast

  5. #5
    The Force is Strong! classact will become famous soon enoughclassact will become famous soon enough classact's Avatar
    Join Date
    March 25, 2008
    Posts
    184
    Rep Power
    5
    Feedback Score
    0

    Default Re: what is this script?

    Quote Originally Posted by EmmaB View Post
    I got a template today and within it was this code
    Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    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[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      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[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    What does this do? I took it out of the html page to see what would happen and nothing happened. Im curious though, anyone know?
    Rollover effect for menus.

    This is what happens when Dreamweaver creates content.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Myspace Script for sale - Comment script
    By Steve in forum Scripts
    Replies: 2
    Last Post: Feb 17th, 2008, 7:31 pm
  2. Best script to use?
    By einsteinsboi in forum HTML & Website Design
    Replies: 10
    Last Post: Aug 14th, 2007, 7:40 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads