Jump to content

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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.