1

I'm making a portfolio site in which each project expands on click and inside there's a image gallery.

The problem I'm facing is that the site gets pretty slow once many images are loaded. Is there a way to load the content on click and once I click some other project, the previous gallery content to be completely unloaded ?

I'm not very experienced with jQuery so an example of this would help a lot.

skxc
  • 275
  • 1
  • 2
  • 13

1 Answers1

0

Once you click, create a new div, load everything you want to show inside that div and show it to the user. Have a button there to close it. Once you do, destroy the div.

To create the div read: Creating a div element in jQuery

To destroy it just $('#div_id').remove();

Community
  • 1
  • 1
tiagoboldt
  • 2,426
  • 1
  • 24
  • 30
  • That would mean I'd have to load every single project individually, sounds a bit messy. – skxc Jun 14 '11 at 09:57