www.webdeveloper.com
Results 1 to 2 of 2

Thread: I need help with javascript menu!

  1. #1
    Join Date
    Apr 2012
    Posts
    2

    I need help with javascript menu!

    Hi, I'm kind of new with developing websites and I've encountered a problem with my javascript menu. The menu works exactly as I want it to; when I press a button my Iframe changes and the button goes to the "pressed-down-state". However, if I click the back button in my browser the iframe goes to the previous page but the button doesn't change.

    I've attached my complete website that you can take a look at (link below). All the javascript code is in hemsida/Scripts/buttons.js and all the functions are called from the buttons in index.html and from the iframe, also in index.html, via an onLoad event.

    As I mentioned I'm pretty new to web development, and you'll notice that in my javascript file (it's chaotic), so I'd really really appreciate it if you could give me some feedback and perhaps improve my work a little x_x

    thanks for taking your time to read this far, I hope you can help!

    Website:
    http://dl.dropbox.com/u/54172995/hemsida.rar

  2. #2
    Join Date
    May 2005
    Location
    Dirty Jersey
    Posts
    1,401
    javascript is all about doing things it's told. so you told javascript to change the iframe's address and to go the pressed down state.

    you'll notice that when you press back, you haven't told javascript to do anything. so that's why your button doesn't change. you didn't tell it to.

    i haven't worked with iframes in this capacity, but i imagine you'd have to manipulate the onload event (REF: http://www.w3schools.com/jsref/dom_obj_frame.asp) to then check with your button and make sure that it changes to reflect the current situation that you expect.

    1. If you reply to my post, and your reply would then appear directly beneath my post, DON'T QUOTE MY ENTIRE POST!!! IT'S REDUNTANT!!! IT'S ASININE!!!! IT'S REDUNDANTLY ASININE!!!!! DON'T DO IT!!!!
    2. jQuery extends the functionality of JavaScript. If you don't know JavaScript, give up on that jQuery script and learn JavaScript. You'll save yourself a lot of frustration, I promise.
    3. Use the [code][/code] tags. Otherwise, you may be left wondering why no one responded to your eyesore of a thread.


Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles