Jump to content

Navigation links opens in one div


thugsr

Recommended Posts

Hi there, i'm wondering if this may be done somehow? Basically i have side navigation and i want to open links from it to central content div, so everything would be on same page. I hope that you understand what i am asking? :) Thank in advance. In attachment is image of how i imagind it. :)

post-117842-13482403685236_thumb.png

Link to comment
https://forums.phpfreaks.com/topic/266897-navigation-links-opens-in-one-div/
Share on other sites

What you need is asynchronous loading of data!

 

I believe you can get the job done with JavaScript/jQuery

 

Try this.

1) Add the latest jQuery library to your project

2) Create separate pages for the content you would like to put in the main div.

3) Use "click" function to trigger "load" function.

 

You can look up the exact syntax as it would be good if your read up on it. It is freely available on the interenet.

click - http://api.jquery.com/click/

load - http://api.jquery.com/load/

 

Using above concept you can write a few lines of script to load a particular html file into a div.

It would make sense to use $(window).load so that you dont slow down the loading of you page.

 

Cheers

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.