I don't believe you are looking for Java coding, but JavaScript specifically. You can find lots of resources or post here - with [ c o d e ] tags to tell us what you have and what you want to do. www.hotscripts.com has lots of resources on how to's / copy/pasting.
Well, I'm working on a website and saw one I liked so I used Download Studio to grab it. I use Adobe Golive and have changed everything but the js won't work correctly. I don't have any experience with js so I'm not having any luck figuring out what I did. It's basically mouse out / over routine and I think it can't find the images. Thanks for the website link I'll check it out for other issues.
The .js file is just a javascript reference file. You can open it up in notepad. You can download it easily if you know how to as well. No additional tools are necessary. It is similar to having a separate .css file for cascading style sheets rather than including the css style sheet in the page itself. It helps for ease of global management, which is basically like an include file. Hope this helps.
I have it......... I've looked at it......... I can't figure out why it isn't working. I don't think it can find the images.
That was a very, very, very, very short screenplay (script) for a very, very, very, very short film called "Java"
// ============================================================================== // // NA_navMain() loops through #nav-main and sets all the ids and events needed // // for this navigation scheme to work properly. After setting all the proper ids // // and events, it calls NA_navMain_init() // // ============================================================================== // function NA_navMain() { // check to make sure this isn't opera 7 if((window.opera && Math.round(navigator.appVersion.substring(0, 1)) > 7) || !window.opera) { if(document.getElementById("nav-main")) { // loop through all IMGs var els = document.getElementById("nav-main").getElementsByTagName("IMG"); var counter = 0; for (var i=0; i<els.length; i++) { // top level IMGs only if (els.parentNode.parentNode.parentNode.parentNode.id == "nav-main") { // sets id of IMG els.id = "nav-main-img-" + counter; // sets id of parent LI - this can't be set via JS, if not present, nav won't show //els.parentNode.parentNode.id = "nav-main-li-" + counter; if (els.parentNode.parentNode.className != "hover") { // sets event of IMG els.onmouseover = function() { this.src = this.src.replace("-off", "-on").replace(".jpg", ".gif"); this.parentNode.parentNode.className = "hover"; } els.onmouseout = function() { this.src = this.src.replace("-on", "-off").replace(".gif", ".jpg"); this.parentNode.parentNode.className = ""; } } counter = counter+1; } } } } } addEvent(window, "load", NA_navMain); // ============================================================================== // // end navigation JS // // ============================================================================== //
Are you previewing the pages in explorer but on your local computer, or are you uploading them and checking them live/online? I had trouble with Dreamweaver on my local before I'd upload when I previewed because I would get a browser bar warning of "to help protect your security blah blah blah" which didn't allow my java rollovers to work. Once I disabled that (or better yet moved to firefox) the rollovers worked in the preview.
could you post the html where you want to run this too? I need to see how nav-main is structured.. or in other words i want to see how the html looks like, in order to test it properly.
Thank you Thank you I would not have solved it without all your help. I esp. want to that Joe for solving it. Yes, I needed to change some image names. (Don't know why as I didn't change the souce files) Oh and of course, the Academy................
Thanks I contacted Adobe last night and told them I just got CS2 Premium and did they have an "upgrade" path to Studio 8". I figured they must now that the own Macromedia............. Short answer - NO After just paying $500 for the upgrade I'm not paying $1000+ for that.....