GoLive rollover problem

  • DeadBolt
  • Novice
  • Novice
  • DeadBolt
  • Posts: 31

Post 3+ Months Ago

Our company has expanded to include website design, so I've had to learn web design pretty quick which is why I chose to learn through GoLive. Anyways, I'm having a problem with mouseOver Rollover images. I have buttons that seem to be working perfectly when I preview them through GoLive or when I preview it to Firefox. But when I upload it to our site the rollovers don't show up on some browsers.

I'm designing on a Mac and the rollovers seem to work on Safari & IE on Mac but not Firefox. They also aren't working on IE or Firefox on PC.

I've created the images in ImageReady and used the 'Rollover' tool in GoLive to create the rollover.

BTW, here is the test link
http://www.ecohost.net/test/index.html

Any help is greatly appreciated

Thnx
BoLt 8)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • DeadBolt
  • Novice
  • Novice
  • DeadBolt
  • Posts: 31

Post 3+ Months Ago

Anyone??

Please!! :wink:
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

The location of a javascript file has gone awry! :D

Code: [ Select ]
<script type="text/javascript" src="file:///Users/nwdc/Library/Preferences/Adobe/GoLive/Settings7/JScripts/GlobalScripts/CSScriptLib.js"></script>
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

GoLive's rollover script uses a function called changeImages that must be in the file called CSScriptLib.js - if you view the source of the page you'll see the following link to the .js file:

Code: [ Select ]
<script type="text/javascript" src="file:///Users/nwdc/Library/Preferences/Adobe/GoLive/Settings7/JScripts/GlobalScripts/CSScriptLib.js"></script>


It currently points to the file on your hard drive, so it probably works when you preview it locally. You need to upload the .js file if you haven't already and change the src part of the tag to point to it. For example, if you upload it to a directory called scripts you could use:

Code: [ Select ]
<script type="text/javascript" src="http://www.echohost.net/scripts/CSScriptLib.js"></script>
  • DeadBolt
  • Novice
  • Novice
  • DeadBolt
  • Posts: 31

Post 3+ Months Ago

Thanks alot RichB,

I'll try that out now.

:D
BoLt
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

er, http://www.ecohost.net/test/CSScriptLib.js

I misread the domain name
  • DeadBolt
  • Novice
  • Novice
  • DeadBolt
  • Posts: 31

Post 3+ Months Ago

Yep, I realized that too. I made that change but it still doesn't seem to be working. Maybe I'm uploading the wrong CSScriptLib.js file. I did a search for that on my hd and found 4 CSScriptLib.js files. I just uploaded the one that was in a folder called GeneratedItems.

Where abouts would I find that file?

Do I just upload it along with the rest of my HTML files?

Do I need to upload one for each page?

Srry 4 all the Q&A

Thnx
BoLt
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

You only need to upload one, and that's the right one. I took a look at it and the changeImages function is inside it. However, when I look at the test html page it still has my spelling error echohost instead of ecohost, so make sure that you've made the change and uploaded the changed html file as well.
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

By the way you can also use a relative path instead of an absolute path. If the .js file is in the same directory you can just use src="CSScriptLib.js"
  • DeadBolt
  • Novice
  • Novice
  • DeadBolt
  • Posts: 31

Post 3+ Months Ago

It works! :D

Thanks a ton Rich, you are truly awesome and helpful. I was nearly pulling my hair out.

here you go
Image
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

Heh, thanks. :)

I like the fish hook rollover images by the way. Don't forget to change the same script tag on your other pages too - you only need the one script file, but all the pages that use the rollover code will have to reference it correctly.
  • DeadBolt
  • Novice
  • Novice
  • DeadBolt
  • Posts: 31

Post 3+ Months Ago

Yep, I realized that. I'm now just trying to reduce the size of that file. I'm reading a tutorial on flattening the CSScriptLib.js file.

Thanks again 8)
  • designer_number_1
  • Born
  • Born
  • designer_number_1
  • Posts: 2

Post 3+ Months Ago

In GoLive, whenever I open and edit a page directly from the server, the script that controls the rollovers always changes from a relative path to a local path on my computer!

For example, this line:

<script type="text/javascript" src="scripts/CSScriptLib.js"></script>

changes to:

<script type="text/javascript" src="file://users/im_a_dummy/scripts/CSScriptLib.js"></script>

It always seems to want to point to my local machine. This happens about 90% of the time. Is there a way to stop this?
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1893
  • Loc: Las Vegas

Post 3+ Months Ago

I'm not trying to sound harsh or anything, but the BEST solution is to take the time to learn how to hand code web sites.
It's not the easiest, or quickest solution, but if you learn to hand code, all you need is a text editor.
When you hand code, you can make sure that what you are working on WORKS, and you don't have to depend on some application's proprietary javascript, AND you don't have to worry about the editor changing your links.
I don't know anything about GoLive, and I'm assuming they have some sort of preference you can set so it DOESN'T change your links, but if you hand code, you don't need any preferences to tell the editor not to change your links.
  • designer_number_1
  • Born
  • Born
  • designer_number_1
  • Posts: 2

Post 3+ Months Ago

Actually i do know how to code by hand. I just don't want to do it. After looking at code all day in the office, I would rather come home and use GoLive. Most people say it, and Dreamweaver and FrontPage suck, but I wish to use it at this point.

So my problem isn't what is this line supposed to be, rather why does this software do what it's doing.
  • steelhead87
  • Newbie
  • Newbie
  • steelhead87
  • Posts: 6

Post 3+ Months Ago

Hello, stumbled across your discussion as it pertains to an issue of my own. My code for the js file is a mess and looks nothing like the examples you folks gave. It has a ton of code and plenty of empty spaces.

I am pretty sure I flatenned it before I saved and uploaded, but perhaps I am mistaken.

Here is mine:

<script type="text/javascript"><!--function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; }}userAgent = window.navigator.userAgent;browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);mustInitImg = true;function initImgID() {var di = document.images; if (mustInitImg && di) { for (var i=0; i<di.length; i++) { if (!di[i].id) di[i].id=di[i].name; } mustInitImg = false;}}function findElement(n,ly) { var d = document; if (browserVers < 4) return d[n]; if ((browserVers >= 6) && (d.getElementById)) {initImgID; return(d.getElementById(n))}; var cd = ly ? ly.document : d; var elem = cd[n]; if (!elem) { for (var i=0;i<cd.layers.length;i++) { elem = findElement(n,cd.layers[i]); if (elem) return elem; } } return elem;}function changeImagesArray(array) { if (preloadFlag == true) { var d = document; var img; for (i=0;i<array.length;i+=2) { img = null; var n = array[i]; if (d.images) { if (d.layers) {img = findElement(n,0);} else {img = d.images[n];} } if (!img && d.getElementById) {img = d.getElementById(n);} if (!img && d.getElementsByName) { var elms = d.getElementsByName(n); if (elms) { for (j=0;j<elms.length;j++) { if (elms[j].src) {img = elms[j]; break;} } } } if (img) {img.src = array[i+1];} } }}function changeImages() { changeImagesArray(changeImages.arguments);}// --></script>
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

Try looking for this little bit...

Code: [ Select ]
return(d.getElementById(n))


There should be a semicolon ending that line before the closing bracket I believe. Give it a shot...that's a lot of jarble to get through.
  • knexor2
  • Proficient
  • Proficient
  • User avatar
  • Posts: 445
  • Loc: US

Post 3+ Months Ago

ScienceOfSpock wrote:
I'm not trying to sound harsh or anything, but the BEST solution is to take the time to learn how to hand code web sites.
It's not the easiest, or quickest solution, but if you learn to hand code, all you need is a text editor.
When you hand code, you can make sure that what you are working on WORKS, and you don't have to depend on some application's proprietary javascript, AND you don't have to worry about the editor changing your links.


Amen to that! :lol:

designer_number_1 wrote:
Actually i do know how to code by hand. I just don't want to do it.


Lazy :P :lol:

Pertaining to steelhead87's issue, the missing semicolon shouldn't matter, as the return statement is directly before a closing semicolon (required in PHP, not in JS ;))

I'll try to look over the JS code and look for any problems (if my brain doesn't explode first). What is the issue with it?

EDIT:~~

If this is a .js file you're uploading, remove the <script> tags and the HTML comments...the JS content will be nullified otherwise.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

For any others who wish to give it a go, I've deciphered it into readable code ;)

***Included the modified line here where I moved a semicolon from outside of the closing 'if' bracket to the end of the return parantheses:
Code: [ Select ]
if ((browserVers >= 6) && (d.getElementById))
    {
      initImgID;
      return(d.getElementById(n));
    }
  1. if ((browserVers >= 6) && (d.getElementById))
  2.     {
  3.       initImgID;
  4.       return(d.getElementById(n));
  5.     }


Code: [ Select ]
<script type="text/javascript">
<!--
  function newImage(arg)
  {
    if (document.images)
    {
      rslt = new Image();
      rslt.src = arg;
      return rslt;
    }
  }

  userAgent = window.navigator.userAgent;
  browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
  mustInitImg = true;



  function initImgID()
  {
    var di = document.images;
    if (mustInitImg && di)
    {
      for (var i=0; i<di.length; i++)
      {
        if (!di[i].id)
        di[i].id=di[i].name;
      }
    mustInitImg = false;
    }
  }



  function findElement(n,ly)
  {
    var d = document;
    if (browserVers < 4)
      return d[n];
    if ((browserVers >= 6) && (d.getElementById))
    {
      initImgID;
      return(d.getElementById(n));
    }
    var cd = ly ? ly.document : d;
    var elem = cd[n];
    if (!elem)
    {
      for (var i=0;i<cd.layers.length;i++)
      {
        elem = findElement(n,cd.layers[i]);
        if (elem)
          return elem;
      }
    }
    return elem;
  }



  function changeImagesArray(array)
  {
    if (preloadFlag == true)
    {
      var d = document;
      var img;
      for (i=0;i<array.length;i+=2)
      {
        img = null;
        var n = array[i];
        if (d.images)
        {
          if (d.layers)
          {
            img = findElement(n,0);
          }
          else
          {
            img = d.images[n];
          }
        }
        if (!img && d.getElementById)
        {
          img = d.getElementById(n);
        }
        if (!img && d.getElementsByName)
        {
          var elms = d.getElementsByName(n);
          if (elms)
          {
            for (j=0;j<elms.length;j++) 
            {
              if (elms[j].src)
              {
                img = elms[j];
                break;
              }
            }
          }
        }
        if (img)
        {
          img.src = array[i+1];
        }
      }
    }
  }
  
  
  function changeImages()
  {
    changeImagesArray(changeImages.arguments);
  }
  
  
// -->
</script>
  1. <script type="text/javascript">
  2. <!--
  3.   function newImage(arg)
  4.   {
  5.     if (document.images)
  6.     {
  7.       rslt = new Image();
  8.       rslt.src = arg;
  9.       return rslt;
  10.     }
  11.   }
  12.   userAgent = window.navigator.userAgent;
  13.   browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
  14.   mustInitImg = true;
  15.   function initImgID()
  16.   {
  17.     var di = document.images;
  18.     if (mustInitImg && di)
  19.     {
  20.       for (var i=0; i<di.length; i++)
  21.       {
  22.         if (!di[i].id)
  23.         di[i].id=di[i].name;
  24.       }
  25.     mustInitImg = false;
  26.     }
  27.   }
  28.   function findElement(n,ly)
  29.   {
  30.     var d = document;
  31.     if (browserVers < 4)
  32.       return d[n];
  33.     if ((browserVers >= 6) && (d.getElementById))
  34.     {
  35.       initImgID;
  36.       return(d.getElementById(n));
  37.     }
  38.     var cd = ly ? ly.document : d;
  39.     var elem = cd[n];
  40.     if (!elem)
  41.     {
  42.       for (var i=0;i<cd.layers.length;i++)
  43.       {
  44.         elem = findElement(n,cd.layers[i]);
  45.         if (elem)
  46.           return elem;
  47.       }
  48.     }
  49.     return elem;
  50.   }
  51.   function changeImagesArray(array)
  52.   {
  53.     if (preloadFlag == true)
  54.     {
  55.       var d = document;
  56.       var img;
  57.       for (i=0;i<array.length;i+=2)
  58.       {
  59.         img = null;
  60.         var n = array[i];
  61.         if (d.images)
  62.         {
  63.           if (d.layers)
  64.           {
  65.             img = findElement(n,0);
  66.           }
  67.           else
  68.           {
  69.             img = d.images[n];
  70.           }
  71.         }
  72.         if (!img && d.getElementById)
  73.         {
  74.           img = d.getElementById(n);
  75.         }
  76.         if (!img && d.getElementsByName)
  77.         {
  78.           var elms = d.getElementsByName(n);
  79.           if (elms)
  80.           {
  81.             for (j=0;j<elms.length;j++) 
  82.             {
  83.               if (elms[j].src)
  84.               {
  85.                 img = elms[j];
  86.                 break;
  87.               }
  88.             }
  89.           }
  90.         }
  91.         if (img)
  92.         {
  93.           img.src = array[i+1];
  94.         }
  95.       }
  96.     }
  97.   }
  98.   
  99.   
  100.   function changeImages()
  101.   {
  102.     changeImagesArray(changeImages.arguments);
  103.   }
  104.   
  105.   
  106. // -->
  107. </script>
  • knexor2
  • Proficient
  • Proficient
  • User avatar
  • Posts: 445
  • Loc: US

Post 3+ Months Ago

Way 2 go UPS :) I was just about to do that XD
  • knexor2
  • Proficient
  • Proficient
  • User avatar
  • Posts: 445
  • Loc: US

Post 3+ Months Ago

Code: [ Select ]
  function findElement(n,ly)
  {
    var d = document;
    if (browserVers < 4)
      return d[n];
    if ((browserVers >= 6) && (d.getElementById))
    {
      initImgID;
      return(d.getElementById(n));
    }
    var cd = ly ? ly.document : d;
    var elem = cd[n];
    if (!elem)
    {
      for (var i=0;i<cd.layers.length;i++)
      {
        elem = findElement(n,cd.layers[i]);
        if (elem)
          return elem;
      }
    }
    return elem;
  }
  1.   function findElement(n,ly)
  2.   {
  3.     var d = document;
  4.     if (browserVers < 4)
  5.       return d[n];
  6.     if ((browserVers >= 6) && (d.getElementById))
  7.     {
  8.       initImgID;
  9.       return(d.getElementById(n));
  10.     }
  11.     var cd = ly ? ly.document : d;
  12.     var elem = cd[n];
  13.     if (!elem)
  14.     {
  15.       for (var i=0;i<cd.layers.length;i++)
  16.       {
  17.         elem = findElement(n,cd.layers[i]);
  18.         if (elem)
  19.           return elem;
  20.       }
  21.     }
  22.     return elem;
  23.   }


Erm...I'm not sure if this is possible (recursive function calls in JS). Every time I've tried using recursive JS functions in the past, I've gotten errors. So you may want to look into that, as well.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

Sure, it's supported, independently & mutually grouped. The structure has a bypass to allow exiting, and from what I can tell, there won't be a DEEP stack to call back, so it should be just fine.
  • steelhead87
  • Newbie
  • Newbie
  • steelhead87
  • Posts: 6

Post 3+ Months Ago

Whoa, thanks everyone for taking the time. I am not sure what eleminate when you say get rid of: "<script> tags and the HTML comments"

I do not write code, hence GoLive useage.

I would really appreciate all your further assistance
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

What's the file name & extension where you pulled this bit of code from?
  • steelhead87
  • Newbie
  • Newbie
  • steelhead87
  • Posts: 6

Post 3+ Months Ago

The file name is home.html. I got the code from the server's file manager when I clicked on edit. I knew what to look for amidst all this code from this thread.

the page in question is http://bentarrgraphicdesign.com/home.html
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

Well, I will say...it definitely jumps off the page, and I'm in 1280x1024! Why so large?

So, now that I have the link in front of me, tell me what the action is that led you to believe there's something wrong with the javascript. Let's start from there instead of jumping in mid-code.
  • steelhead87
  • Newbie
  • Newbie
  • steelhead87
  • Posts: 6

Post 3+ Months Ago

I read other posts that involved rollover images, in my case animated gif files, working locally but not remotely.

The suggestion was to flaten the CSScriptLib.js file and re-upload it. According to them, the scriptlib file is needed for javscriptfunctions that are resonsible for linking rollover images (gif anime) with their target.

I paraphrased. Here is a link to the adobe forum I posted on
http://www.adobeforums.com/cgi-bin/webx?128@@.3bc37405

I even selected in GoLive for the javascript to be written into the page insted of referenceing a file locally on my HD
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

A little clearer now. Unfortunately, I'm not much of a GoLive expert, & don't see the problem up front, but hang tight...there are MUCH smarter people than me lingering.
  • steelhead87
  • Newbie
  • Newbie
  • steelhead87
  • Posts: 6

Post 3+ Months Ago

Well, thank-you none the less. I appreciate it.

Maybe I just can't use gif animation as a rollover source.

The funny thing is, I originally had the page open with the interface in the center spinning as it appeared. I changed it so the page would load faster. I thought I'd try something simple and it won't work!

Oh, why it's so big. I use 1280x1024 on my Appple studio monitor and all the computers at work are set to that as well. I wanted to fill the screen of a common monitor resolution. I set the web page size accordingly. Is that really odd? It made sense at the time. don't know.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

I use 1280 1024 myself, and still scroll, but most likely b/c I use toolbars in FF. Good compatible sites should be browser and resolution scalable to a point. ;) You could do well by shrinking it all down & using an outline to surround it. Doing a google for 'website templates' to get a good browse of some basic up-to-trend ideas could help ya.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 33 posts
  • Users browsing this forum: No registered users and 76 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.