Switching divs on a page
Permalink
Hello everyone... I have a question for you guys which i havent been able to find anything about at all.
Here we go. Imagine this is a website:
<header div>
<navigation div>
<gallery div>
<main content div>
<footer div>
Then i want to be able to click a link in my <main content div> and with that link it will change the <gallery div> with another <gallery div> and nothing else, all the other divs on the page should still be there.
hope you understand my question :)
Here we go. Imagine this is a website:
<header div>
<navigation div>
<gallery div>
<main content div>
<footer div>
Then i want to be able to click a link in my <main content div> and with that link it will change the <gallery div> with another <gallery div> and nothing else, all the other divs on the page should still be there.
hope you understand my question :)
Well i think there will be like 30-45 links, so havgin so many galleries hidden would be a hassle right?
So Ajax is the way to do this? Is that something that will take a lot of hours to make work for a newb like me or is it possible to master pretty fast?
So Ajax is the way to do this? Is that something that will take a lot of hours to make work for a newb like me or is it possible to master pretty fast?
You definitely want method (2)
If you know jQuery, it shouldn't be that hard. However, first have a good look at the ajax paging addon.
With that you set up a page for each gallery (and set them to not show in the navigation), then use ajax paging to connect the links to the various galleries and the area (or div) you want to replace.
If you know jQuery, it shouldn't be that hard. However, first have a good look at the ajax paging addon.
With that you set up a page for each gallery (and set them to not show in the navigation), then use ajax paging to connect the links to the various galleries and the area (or div) you want to replace.
1. Have the other gallery already loaded but hidden. When you click the link, use jquery to hide the existing gallery and show the new one. The accordion and tab addons already do this sort of thing.
2. Load the other gallery by ajax to replace the existing gallery. To do this, when you click the link, use jquery ajax load to get/load the new gallery.
Some addons that may help with (2):
http://www.concrete5.org/marketplace/addons/ajax-lessons/... - some lessons/examples on using ajax.
http://www.concrete5.org/marketplace/addons/rapid-ajax-paging/... - will probably do what you want.