Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Menu with Java script... shows menu state

Featured Replies

Hi everyone,

I want to be able to include one menu in everyone of my web pages using php include, which is easey enough!!

But I want the user to see the link that they are currently on,

see my website that I'm working on to see the example,

http://www.highwoodhealth.org/test/

 

See that once you have clicked on one of the menu links and the page loads up, the link appears to be deactivated (although only the color and cursor have changed!!)..

 

Can I do this with a java script?? but with only one menu file that is included into all the pages???

 

I think that it is clearer for a visitor to navigate if they can see which page they are on...

 

thanks for any help

 

Cheers

 

Emmanuel

This can be done using javascript. I am not sure if you have Dreamweaver CS3, but it has the SPRY widgets that are contained in the program. Once you become fimilar with the spry menu widget you will want to then create a seperate page in your include folder, and name it menu.php. Once that has been done, put the menu code in there. Only put the menu code, dont put the heading script or anything else except the javascript that goes in the body. This is kind of like using an iframe except without the frame. Now put the include on the index.php page that links to the menu.php. Also please be sure that you also include the <head> javascript information on the page.

 

This should work, let me know if you have any further questions.

  • Author
This can be done using javascript. I am not sure if you have Dreamweaver CS3, but it has the SPRY widgets that are contained in the program. Once you become fimilar with the spry menu widget you will want to then create a seperate page in your include folder, and name it menu.php. Once that has been done, put the menu code in there. Only put the menu code, dont put the heading script or anything else except the javascript that goes in the body. This is kind of like using an iframe except without the frame. Now put the include on the index.php page that links to the menu.php. Also please be sure that you also include the <head> javascript information on the page.

 

This should work, let me know if you have any further questions.

 

thanks, I should be able to include the file ok, it is just that I need a script that can work from one file and that will change when user clicks on it and takes it to another page...

 

Thanks for help

 

Emmanuel

thanks, I should be able to include the file ok, it is just that I need a script that can work from one file and that will change when user clicks on it and takes it to another page...

 

Thanks for help

 

Emmanuel

 

 

 

Right, but it will work only if you have the menu framework inside the menu.php and the script ref'd properly on each page. This should be fine when someone clicks on a different page.

  • Author
Right, but it will work only if you have the menu framework inside the menu.php and the script ref'd properly on each page. This should be fine when someone clicks on a different page.

 

OK, I'm only just trying to learn php and java code, so is there any way you can help me?

I will see what I can put together, i will get back with on everything.

 

OK, I'm only just trying to learn php and java code, so is there any way you can help me?

Ok, here is what I have. I created a index.php and use a php include.

 

<?php
include('menu.php');
?>

 

This means the php include will call for the menu.php to be put in the index.php. This is kinda like using an iframe, but with out the frame.

 

So now you can put anything in the menu.php page and it will show up on the index.php.

 

I already created a sample, take a look at how I used the php include to show the horizontal spry menu.

 

Let me know if you have any questions.

test.zip

  • Author
Ok, here is what I have. I created a index.php and use a php include.

 

<?php
include('menu.php');
?>

 

This means the php include will call for the menu.php to be put in the index.php. This is kinda like using an iframe, but with out the frame.

 

So now you can put anything in the menu.php page and it will show up on the index.php.

 

I already created a sample, take a look at how I used the php include to show the horizontal spry menu.

 

Let me know if you have any questions.

 

Thanks for your help :)

 

I'll put this in my website!

 

Cheers

 

Emmanuel

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.